This is the abridged developer documentation for meshcore-ts
# meshcore-ts
> A MeshCore companion TypeScript library for Node.js.
## Install [Section titled “Install”](#install)
```sh
pnpm add @andyshinn/meshcore-ts
```
Stateful session, injected ports Construct a `MeshCoreSession` with an injected `Transport` (and optional `Logger`). The session owns a typed event emitter and in-memory session state; it never writes to disk. You own persistence Subscribe to events (`contacts`, `messages`, `owner`, …) and store them however you want. On reconnect the session re-syncs from the radio. Zero runtime dependencies Only `node:buffer` / `node:crypto`. BLE/serial drivers stay your responsibility behind the `Transport` port. Multi-instance safe No module-level singletons — every session keeps its own state, so you can run several concurrently in one process. ## Docs for LLMs [Section titled “Docs for LLMs”](#docs-for-llms) This site publishes [`llms.txt`](llms.txt) files following the [llms.txt convention](https://llmstxt.org/) so AI assistants and coding tools can ingest the documentation directly: * [`llms.txt`](llms.txt) — index and overview, linking to the full sets * [`llms-full.txt`](llms-full.txt) — the complete documentation in one file * [`llms-small.txt`](llms-small.txt) — a compact version for smaller context windows
# ContactTableFullError
Defined in: [src/model/errors.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L15) Thrown when CMD\_ADD\_UPDATE\_CONTACT is rejected with ERR\_CODE\_TABLE\_FULL — the radio’s on-device contact store is full (overwrite-oldest off, or every slot is a favourite). Maps to HTTP 409. The message is user-facing. ## Extends [Section titled “Extends”](#extends) * `Error` ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new ContactTableFullError(): ContactTableFullError;
```
Defined in: [src/model/errors.ts:16](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L16) #### Returns [Section titled “Returns”](#returns) `ContactTableFullError` #### Overrides [Section titled “Overrides”](#overrides)
```ts
Error.constructor
```
## Properties [Section titled “Properties”](#properties) ### cause? [Section titled “cause?”](#cause)
```ts
optional cause?: unknown;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 #### Inherited from [Section titled “Inherited from”](#inherited-from)
```ts
Error.cause
```
*** ### message [Section titled “message”](#message)
```ts
message: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 #### Inherited from [Section titled “Inherited from”](#inherited-from-1)
```ts
Error.message
```
*** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 #### Inherited from [Section titled “Inherited from”](#inherited-from-2)
```ts
Error.name
```
*** ### stack? [Section titled “stack?”](#stack)
```ts
optional stack?: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 #### Inherited from [Section titled “Inherited from”](#inherited-from-3)
```ts
Error.stack
```
*** ### stackTraceLimit [Section titled “stackTraceLimit”](#stacktracelimit)
```ts
static stackTraceLimit: number;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:67 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from [Section titled “Inherited from”](#inherited-from-4)
```ts
Error.stackTraceLimit
```
## Methods [Section titled “Methods”](#methods) ### captureStackTrace() [Section titled “captureStackTrace()”](#capturestacktrace)
```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called.
```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance:
```js
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
```
#### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ----------------- | ---------- | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns [Section titled “Returns”](#returns-1) `void` #### Inherited from [Section titled “Inherited from”](#inherited-from-5)
```ts
Error.captureStackTrace
```
*** ### prepareStackTrace() [Section titled “prepareStackTrace()”](#preparestacktrace)
```ts
static prepareStackTrace(err, stackTraces): any;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:55 #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ------------- | ------------- | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns [Section titled “Returns”](#returns-2) `any` #### See [Section titled “See”](#see) #### Inherited from [Section titled “Inherited from”](#inherited-from-6)
```ts
Error.prepareStackTrace
```
# FeatureDisabledError
Defined in: [src/model/errors.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L37) Thrown when a build-flag-gated command (e.g. private-key export/import) is answered with RESP\_DISABLED on this firmware build. ## Extends [Section titled “Extends”](#extends) * `Error` ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new FeatureDisabledError(): FeatureDisabledError;
```
Defined in: [src/model/errors.ts:38](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L38) #### Returns [Section titled “Returns”](#returns) `FeatureDisabledError` #### Overrides [Section titled “Overrides”](#overrides)
```ts
Error.constructor
```
## Properties [Section titled “Properties”](#properties) ### cause? [Section titled “cause?”](#cause)
```ts
optional cause?: unknown;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 #### Inherited from [Section titled “Inherited from”](#inherited-from)
```ts
Error.cause
```
*** ### message [Section titled “message”](#message)
```ts
message: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 #### Inherited from [Section titled “Inherited from”](#inherited-from-1)
```ts
Error.message
```
*** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 #### Inherited from [Section titled “Inherited from”](#inherited-from-2)
```ts
Error.name
```
*** ### stack? [Section titled “stack?”](#stack)
```ts
optional stack?: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 #### Inherited from [Section titled “Inherited from”](#inherited-from-3)
```ts
Error.stack
```
*** ### stackTraceLimit [Section titled “stackTraceLimit”](#stacktracelimit)
```ts
static stackTraceLimit: number;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:67 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from [Section titled “Inherited from”](#inherited-from-4)
```ts
Error.stackTraceLimit
```
## Methods [Section titled “Methods”](#methods) ### captureStackTrace() [Section titled “captureStackTrace()”](#capturestacktrace)
```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called.
```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance:
```js
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
```
#### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ----------------- | ---------- | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns [Section titled “Returns”](#returns-1) `void` #### Inherited from [Section titled “Inherited from”](#inherited-from-5)
```ts
Error.captureStackTrace
```
*** ### prepareStackTrace() [Section titled “prepareStackTrace()”](#preparestacktrace)
```ts
static prepareStackTrace(err, stackTraces): any;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:55 #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ------------- | ------------- | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns [Section titled “Returns”](#returns-2) `any` #### See [Section titled “See”](#see) #### Inherited from [Section titled “Inherited from”](#inherited-from-6)
```ts
Error.prepareStackTrace
```
# ProtocolError
Defined in: [src/model/errors.ts:24](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L24) Thrown when a companion command is answered with RESP\_ERR. `errorCode` is the firmware error byte (ERR\_CODE\_\*); undefined on a bare RESP\_ERR. ## Extends [Section titled “Extends”](#extends) * `Error` ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new ProtocolError(errorCode?): ProtocolError;
```
Defined in: [src/model/errors.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L25) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------ | -------- | | `errorCode?` | `number` | #### Returns [Section titled “Returns”](#returns) `ProtocolError` #### Overrides [Section titled “Overrides”](#overrides)
```ts
Error.constructor
```
## Properties [Section titled “Properties”](#properties) ### cause? [Section titled “cause?”](#cause)
```ts
optional cause?: unknown;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 #### Inherited from [Section titled “Inherited from”](#inherited-from)
```ts
Error.cause
```
*** ### errorCode? [Section titled “errorCode?”](#errorcode)
```ts
readonly optional errorCode?: number;
```
Defined in: [src/model/errors.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L25) *** ### message [Section titled “message”](#message)
```ts
message: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 #### Inherited from [Section titled “Inherited from”](#inherited-from-1)
```ts
Error.message
```
*** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 #### Inherited from [Section titled “Inherited from”](#inherited-from-2)
```ts
Error.name
```
*** ### stack? [Section titled “stack?”](#stack)
```ts
optional stack?: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 #### Inherited from [Section titled “Inherited from”](#inherited-from-3)
```ts
Error.stack
```
*** ### stackTraceLimit [Section titled “stackTraceLimit”](#stacktracelimit)
```ts
static stackTraceLimit: number;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:67 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from [Section titled “Inherited from”](#inherited-from-4)
```ts
Error.stackTraceLimit
```
## Methods [Section titled “Methods”](#methods) ### captureStackTrace() [Section titled “captureStackTrace()”](#capturestacktrace)
```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called.
```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance:
```js
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
```
#### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ----------------- | ---------- | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns [Section titled “Returns”](#returns-1) `void` #### Inherited from [Section titled “Inherited from”](#inherited-from-5)
```ts
Error.captureStackTrace
```
*** ### prepareStackTrace() [Section titled “prepareStackTrace()”](#preparestacktrace)
```ts
static prepareStackTrace(err, stackTraces): any;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:55 #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ------------- | ------------- | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns [Section titled “Returns”](#returns-2) `any` #### See [Section titled “See”](#see) #### Inherited from [Section titled “Inherited from”](#inherited-from-6)
```ts
Error.prepareStackTrace
```
# ProtocolTimeoutError
Defined in: [src/model/errors.ts:45](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L45) Thrown when a companion request times out waiting for its expected reply. ## Extends [Section titled “Extends”](#extends) * `Error` ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new ProtocolTimeoutError(expectedCode): ProtocolTimeoutError;
```
Defined in: [src/model/errors.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L46) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | -------------- | -------- | | `expectedCode` | `number` | #### Returns [Section titled “Returns”](#returns) `ProtocolTimeoutError` #### Overrides [Section titled “Overrides”](#overrides)
```ts
Error.constructor
```
## Properties [Section titled “Properties”](#properties) ### cause? [Section titled “cause?”](#cause)
```ts
optional cause?: unknown;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 #### Inherited from [Section titled “Inherited from”](#inherited-from)
```ts
Error.cause
```
*** ### expectedCode [Section titled “expectedCode”](#expectedcode)
```ts
readonly expectedCode: number;
```
Defined in: [src/model/errors.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L46) *** ### message [Section titled “message”](#message)
```ts
message: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 #### Inherited from [Section titled “Inherited from”](#inherited-from-1)
```ts
Error.message
```
*** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 #### Inherited from [Section titled “Inherited from”](#inherited-from-2)
```ts
Error.name
```
*** ### stack? [Section titled “stack?”](#stack)
```ts
optional stack?: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 #### Inherited from [Section titled “Inherited from”](#inherited-from-3)
```ts
Error.stack
```
*** ### stackTraceLimit [Section titled “stackTraceLimit”](#stacktracelimit)
```ts
static stackTraceLimit: number;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:67 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from [Section titled “Inherited from”](#inherited-from-4)
```ts
Error.stackTraceLimit
```
## Methods [Section titled “Methods”](#methods) ### captureStackTrace() [Section titled “captureStackTrace()”](#capturestacktrace)
```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called.
```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance:
```js
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
```
#### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ----------------- | ---------- | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns [Section titled “Returns”](#returns-1) `void` #### Inherited from [Section titled “Inherited from”](#inherited-from-5)
```ts
Error.captureStackTrace
```
*** ### prepareStackTrace() [Section titled “prepareStackTrace()”](#preparestacktrace)
```ts
static prepareStackTrace(err, stackTraces): any;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:55 #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ------------- | ------------- | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns [Section titled “Returns”](#returns-2) `any` #### See [Section titled “See”](#see) #### Inherited from [Section titled “Inherited from”](#inherited-from-6)
```ts
Error.prepareStackTrace
```
# UnknownContactError
Defined in: [src/model/errors.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L5) Thrown when a contact operation references a public key that isn’t in the discovered pool, so it can’t be added to the radio or favourited. Maps to HTTP 422 (request well-formed, but the referenced contact can’t be acted on) rather than a 503 device error. ## Extends [Section titled “Extends”](#extends) * `Error` ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new UnknownContactError(publicKeyHex): UnknownContactError;
```
Defined in: [src/model/errors.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L6) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | -------------- | -------- | | `publicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns) `UnknownContactError` #### Overrides [Section titled “Overrides”](#overrides)
```ts
Error.constructor
```
## Properties [Section titled “Properties”](#properties) ### cause? [Section titled “cause?”](#cause)
```ts
optional cause?: unknown;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 #### Inherited from [Section titled “Inherited from”](#inherited-from)
```ts
Error.cause
```
*** ### message [Section titled “message”](#message)
```ts
message: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 #### Inherited from [Section titled “Inherited from”](#inherited-from-1)
```ts
Error.message
```
*** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 #### Inherited from [Section titled “Inherited from”](#inherited-from-2)
```ts
Error.name
```
*** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
readonly publicKeyHex: string;
```
Defined in: [src/model/errors.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/errors.ts#L6) *** ### stack? [Section titled “stack?”](#stack)
```ts
optional stack?: string;
```
Defined in: node\_modules/.pnpm/typescript\@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 #### Inherited from [Section titled “Inherited from”](#inherited-from-3)
```ts
Error.stack
```
*** ### stackTraceLimit [Section titled “stackTraceLimit”](#stacktracelimit)
```ts
static stackTraceLimit: number;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:67 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from [Section titled “Inherited from”](#inherited-from-4)
```ts
Error.stackTraceLimit
```
## Methods [Section titled “Methods”](#methods) ### captureStackTrace() [Section titled “captureStackTrace()”](#capturestacktrace)
```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:51 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called.
```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance:
```js
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
```
#### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ----------------- | ---------- | | `targetObject` | `object` | | `constructorOpt?` | `Function` | #### Returns [Section titled “Returns”](#returns-1) `void` #### Inherited from [Section titled “Inherited from”](#inherited-from-5)
```ts
Error.captureStackTrace
```
*** ### prepareStackTrace() [Section titled “prepareStackTrace()”](#preparestacktrace)
```ts
static prepareStackTrace(err, stackTraces): any;
```
Defined in: node\_modules/.pnpm/@types+node\@25.9.3/node\_modules/@types/node/globals.d.ts:55 #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ------------- | ------------- | | `err` | `Error` | | `stackTraces` | `CallSite`\[] | #### Returns [Section titled “Returns”](#returns-2) `any` #### See [Section titled “See”](#see) #### Inherited from [Section titled “Inherited from”](#inherited-from-6)
```ts
Error.prepareStackTrace
```
# AdvertPath
Defined in: [src/features/pathDiagnostics.ts:40](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L40) The device’s cached advert path for a contact. ## Properties [Section titled “Properties”](#properties) ### hops [Section titled “hops”](#hops)
```ts
hops: number;
```
Defined in: [src/features/pathDiagnostics.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L42) *** ### pathHex [Section titled “pathHex”](#pathhex)
```ts
pathHex: string;
```
Defined in: [src/features/pathDiagnostics.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L43) *** ### recvTimestampUnix [Section titled “recvTimestampUnix”](#recvtimestampunix)
```ts
recvTimestampUnix: number;
```
Defined in: [src/features/pathDiagnostics.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L41)
# AutoAddFlagsInput
Defined in: [src/features/autoAdd.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L6) ## Properties [Section titled “Properties”](#properties) ### chat [Section titled “chat”](#chat)
```ts
chat: boolean;
```
Defined in: [src/features/autoAdd.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L7) *** ### overwriteOldest [Section titled “overwriteOldest”](#overwriteoldest)
```ts
overwriteOldest: boolean;
```
Defined in: [src/features/autoAdd.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L11) *** ### radioMaxHops? [Section titled “radioMaxHops?”](#radiomaxhops)
```ts
optional radioMaxHops?: number;
```
Defined in: [src/features/autoAdd.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L15) Radio-side autoadd\_max\_hops byte. When provided, a 3-byte SET payload is emitted so the radio updates its stored value; when omitted the 2-byte payload is used and the radio preserves its stored value. *** ### repeater [Section titled “repeater”](#repeater)
```ts
repeater: boolean;
```
Defined in: [src/features/autoAdd.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L8) *** ### room [Section titled “room”](#room)
```ts
room: boolean;
```
Defined in: [src/features/autoAdd.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L9) *** ### sensor [Section titled “sensor”](#sensor)
```ts
sensor: boolean;
```
Defined in: [src/features/autoAdd.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/autoAdd.ts#L10)
# DefaultFloodScope
Defined in: [src/features/floodScope.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/floodScope.ts#L10) ## Properties [Section titled “Properties”](#properties) ### keyHex [Section titled “keyHex”](#keyhex)
```ts
keyHex: string;
```
Defined in: [src/features/floodScope.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/floodScope.ts#L12) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/features/floodScope.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/floodScope.ts#L11)
# DiscoveredPath
Defined in: [src/features/pathDiagnostics.ts:47](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L47) The round-trip path discovered by a path-discovery request. ## Properties [Section titled “Properties”](#properties) ### inHops [Section titled “inHops”](#inhops)
```ts
inHops: number;
```
Defined in: [src/features/pathDiagnostics.ts:51](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L51) *** ### inPathHex [Section titled “inPathHex”](#inpathhex)
```ts
inPathHex: string;
```
Defined in: [src/features/pathDiagnostics.ts:52](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L52) *** ### outHops [Section titled “outHops”](#outhops)
```ts
outHops: number;
```
Defined in: [src/features/pathDiagnostics.ts:49](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L49) *** ### outPathHex [Section titled “outPathHex”](#outpathhex)
```ts
outPathHex: string;
```
Defined in: [src/features/pathDiagnostics.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L50) *** ### pubKeyPrefixHex [Section titled “pubKeyPrefixHex”](#pubkeyprefixhex)
```ts
pubKeyPrefixHex: string;
```
Defined in: [src/features/pathDiagnostics.ts:48](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/pathDiagnostics.ts#L48)
# Feature
Defined in: [src/features/feature.ts:58](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L58) A protocol feature: owns the inbound wire codes it reacts to. Feature modules also export their own encode\* / decode\* functions and session-facing functions; those are wired explicitly by the session. ## Properties [Section titled “Properties”](#properties) ### handles [Section titled “handles”](#handles)
```ts
readonly handles: readonly number[];
```
Defined in: [src/features/feature.ts:60](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L60) Inbound RESP\_\* / PUSH\_\* codes this feature decodes & reacts to. ## Methods [Section titled “Methods”](#methods) ### handle() [Section titled “handle()”](#handle)
```ts
handle(
code,
frame,
ctx): void;
```
Defined in: [src/features/feature.ts:62](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L62) React to an inbound frame whose code is one of `handles`. #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------- | | `code` | `number` | | `frame` | `Buffer` | | `ctx` | [`FeatureContext`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/featurecontext/) | #### Returns [Section titled “Returns”](#returns) `void`
# FeatureContext
Defined in: [src/features/feature.ts:23](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L23) The controlled slice of a session a feature module may touch. Every shared capability is injected here per-session — the transport-facing helpers, the ports (events, log, admin) and model (state), plus the per-session mutable feature state in `rt`. Nothing is reached via module-level singletons. ## Properties [Section titled “Properties”](#properties) ### admin [Section titled “admin”](#admin)
```ts
readonly admin: AdminSessionStore;
```
Defined in: [src/features/feature.ts:44](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L44) Repeater admin auth + pending-request store (was `adminSessions`). *** ### events [Section titled “events”](#events)
```ts
readonly events: Events;
```
Defined in: [src/features/feature.ts:38](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L38) Event bus the feature broadcasts on (was the module-level `emit`). *** ### log [Section titled “log”](#log)
```ts
readonly log: Logger;
```
Defined in: [src/features/feature.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L42) Structured logger (was `child('protocol')`). *** ### rt [Section titled “rt”](#rt)
```ts
readonly rt: SessionRuntime;
```
Defined in: [src/features/feature.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L46) Per-session mutable feature state (replaces module-level let/const). *** ### state [Section titled “state”](#state)
```ts
readonly state: SessionState;
```
Defined in: [src/features/feature.ts:40](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L40) In-memory session model the feature reads & mutates (was `stateHolder()`). ## Methods [Section titled “Methods”](#methods) ### contactsSync() [Section titled “contactsSync()”](#contactssync)
```ts
contactsSync(signal): void;
```
Defined in: [src/features/feature.ts:52](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L52) INTERNAL contact-sync signal sink (was the module-level `emit.contactsSync`). The session implements this to drive the handshake’s syncProgress + start/done waiters; it is NOT a public event. #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------------------------------------------------------------------------------------------- | | `signal` | [`ContactsSyncSignal`](/meshcore-ts/api/andyshinn/namespaces/features/type-aliases/contactssyncsignal/) | #### Returns [Section titled “Returns”](#returns) `void` *** ### getTransportState() [Section titled “getTransportState()”](#gettransportstate)
```ts
getTransportState(): TransportState;
```
Defined in: [src/features/feature.ts:48](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L48) Current transport connection state (replaces transportManager.getState()). #### Returns [Section titled “Returns”](#returns-1) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) *** ### request() [Section titled “request()”](#request)
```ts
request(frame, opts?): Promise>;
```
Defined in: [src/features/feature.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L29) Send a frame and await its reply. With `expect`, resolves the next inbound frame whose code === expect (a typed GET reply). Without `expect`, awaits the next RESP\_OK/RESP\_ERR and rejects with ProtocolError on RESP\_ERR. #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ----------------- | ------------------------------------------------ | | `frame` | `Buffer` | | `opts?` | { `expect?`: `number`; `timeoutMs?`: `number`; } | | `opts.expect?` | `number` | | `opts.timeoutMs?` | `number` | #### Returns [Section titled “Returns”](#returns-2) `Promise`<`Buffer`<`ArrayBufferLike`>> *** ### requestOrNull() [Section titled “requestOrNull()”](#requestornull)
```ts
requestOrNull(
frame,
expect,
timeoutMs?): Promise | null>;
```
Defined in: [src/features/feature.ts:36](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L36) Send a frame and await either its typed reply (code === expect) OR a RESP\_ERR — for GETs that legitimately answer “not found” (e.g. no cached advert path). Resolves the typed frame, or null on RESP\_ERR. The RESP\_ERR is consumed via the shared ack FIFO so it can’t be mistaken for a rejected DM send. Rejects on timeout / write failure / disconnect. `expect` must be a typed reply code, not RESP\_OK/RESP\_ERR. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ------------ | -------- | | `frame` | `Buffer` | | `expect` | `number` | | `timeoutMs?` | `number` | #### Returns [Section titled “Returns”](#returns-3) `Promise`<`Buffer`<`ArrayBufferLike`> | `null`> *** ### writeFrame() [Section titled “writeFrame()”](#writeframe)
```ts
writeFrame(frame): Promise;
```
Defined in: [src/features/feature.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L25) Write a raw companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | #### Returns [Section titled “Returns”](#returns-4) `Promise`<`void`>
# RepeatFreqRange
Defined in: [src/features/misc.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/misc.ts#L10) An inclusive frequency range the radio is permitted to repeat on. Values are in **kHz** (e.g. 433000 = 433 MHz, 869495 = 869.495 MHz, 918000 = 918 MHz). ## Properties [Section titled “Properties”](#properties) ### lowerKhz [Section titled “lowerKhz”](#lowerkhz)
```ts
lowerKhz: number;
```
Defined in: [src/features/misc.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/misc.ts#L11) *** ### upperKhz [Section titled “upperKhz”](#upperkhz)
```ts
upperKhz: number;
```
Defined in: [src/features/misc.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/misc.ts#L12)
# SelfInfo
Defined in: [src/features/selfInfo.ts:23](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L23) ## Properties [Section titled “Properties”](#properties) ### advertLocPolicy [Section titled “advertLocPolicy”](#advertlocpolicy)
```ts
advertLocPolicy: number;
```
Defined in: [src/features/selfInfo.ts:39](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L39) Advertise location policy (frame\[45]). *** ### advType [Section titled “advType”](#advtype)
```ts
advType: number;
```
Defined in: [src/features/selfInfo.ts:27](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L27) Advertisement type byte (frame\[1]). *** ### bwHz [Section titled “bwHz”](#bwhz)
```ts
bwHz: number;
```
Defined in: [src/features/selfInfo.ts:59](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L59) Radio bandwidth in Hz (readUInt32LE(52)). The firmware sends prefs.bw \* 1000 so the wire value is already Hz (e.g. 250000 = 250 kHz). *** ### cr [Section titled “cr”](#cr)
```ts
cr: number;
```
Defined in: [src/features/selfInfo.ts:63](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L63) LoRa coding rate (frame\[57]). *** ### freqKhz [Section titled “freqKhz”](#freqkhz)
```ts
freqKhz: number;
```
Defined in: [src/features/selfInfo.ts:53](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L53) Radio frequency in kHz (readUInt32LE(48)). The firmware sends prefs.freq \* 1000 so the wire value is already kHz (e.g. 915000 = 915 MHz). *** ### latDeg [Section titled “latDeg”](#latdeg)
```ts
latDeg: number;
```
Defined in: [src/features/selfInfo.ts:33](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L33) Latitude in decimal degrees (readInt32LE(36) / 1\_000\_000). *** ### lonDeg [Section titled “lonDeg”](#londeg)
```ts
lonDeg: number;
```
Defined in: [src/features/selfInfo.ts:35](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L35) Longitude in decimal degrees (readInt32LE(40) / 1\_000\_000). *** ### manualAddContacts [Section titled “manualAddContacts”](#manualaddcontacts)
```ts
manualAddContacts: number;
```
Defined in: [src/features/selfInfo.ts:47](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L47) Manual add contacts flag (frame\[47]). *** ### maxTxPowerDbm [Section titled “maxTxPowerDbm”](#maxtxpowerdbm)
```ts
maxTxPowerDbm: number;
```
Defined in: [src/features/selfInfo.ts:31](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L31) Maximum LoRa TX power in dBm (frame\[3]). *** ### multiAcks [Section titled “multiAcks”](#multiacks)
```ts
multiAcks: number;
```
Defined in: [src/features/selfInfo.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L37) Multi-ACK setting (frame\[44]). *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/features/selfInfo.ts:24](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L24) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/features/selfInfo.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L25) *** ### sf [Section titled “sf”](#sf)
```ts
sf: number;
```
Defined in: [src/features/selfInfo.ts:61](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L61) LoRa spreading factor (frame\[56]). *** ### telemetryModeBase [Section titled “telemetryModeBase”](#telemetrymodebase)
```ts
telemetryModeBase: number;
```
Defined in: [src/features/selfInfo.ts:45](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L45) Telemetry mode — base component, bits \[1:0] of frame\[46], 0..3. *** ### telemetryModeEnv [Section titled “telemetryModeEnv”](#telemetrymodeenv)
```ts
telemetryModeEnv: number;
```
Defined in: [src/features/selfInfo.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L41) Telemetry mode — environment component, bits \[5:4] of frame\[46], 0..3. *** ### telemetryModeLoc [Section titled “telemetryModeLoc”](#telemetrymodeloc)
```ts
telemetryModeLoc: number;
```
Defined in: [src/features/selfInfo.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L43) Telemetry mode — location component, bits \[3:2] of frame\[46], 0..3. *** ### txPowerDbm [Section titled “txPowerDbm”](#txpowerdbm)
```ts
txPowerDbm: number;
```
Defined in: [src/features/selfInfo.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/selfInfo.ts#L29) TX power in dBm, signed (frame\[2]).
# TuningParams
Defined in: [src/features/tuning.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/tuning.ts#L9) ## Properties [Section titled “Properties”](#properties) ### airtimeFactor [Section titled “airtimeFactor”](#airtimefactor)
```ts
airtimeFactor: number;
```
Defined in: [src/features/tuning.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/tuning.ts#L13) Airtime budget multiplier applied to flood forwarding. *** ### rxDelayBase [Section titled “rxDelayBase”](#rxdelaybase)
```ts
rxDelayBase: number;
```
Defined in: [src/features/tuning.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/tuning.ts#L11) Base of the rx-delay backoff curve. 0 disables the delay.
# AdminMode
```ts
type AdminMode = "local" | "remote";
```
Defined in: [src/features/adminSessions.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/adminSessions.ts#L7)
# ContactsSyncSignal
```ts
type ContactsSyncSignal =
| {
phase: "start";
total: number | null;
}
| {
done: number;
phase: "progress";
total: number;
}
| {
done: number;
phase: "done";
};
```
Defined in: [src/features/feature.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/feature.ts#L14) Contact-sync coordination signal emitted by the contacts feature while a GET\_CONTACTS iteration streams in. The session forwards it to the handshake’s progress + start/done waiters (see onContactsSync). This is an INTERNAL signal delivered via the [FeatureContext.contactsSync](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/featurecontext/#contactssync) callback — it is NOT a public event on [MeshCoreEvents](/meshcore-ts/api/andyshinn/namespaces/ports/classes/events/).
# FloodScopeInput
```ts
type FloodScopeInput =
| {
keyHex: string;
}
| {
clear: true;
}
| {
unscoped: true;
};
```
Defined in: [src/features/floodScope.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/floodScope.ts#L20)
# RepeaterReachMode
```ts
type RepeaterReachMode = "direct" | "flood" | "path";
```
Defined in: [src/features/repeaterAdmin.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/features/repeaterAdmin.ts#L42) How a repeater login was actually dispatched, so the UI can label the toast: `'direct'` (companion-side CMD\_SEND\_LOGIN), `'path'` (mesh-routed over a known out-path) or `'flood'` (mesh-routed, no path).
# MeshObservations
Defined in: [src/model/meshObservations.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L37) ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new MeshObservations(): MeshObservations;
```
#### Returns [Section titled “Returns”](#returns) `MeshObservations` ## Methods [Section titled “Methods”](#methods) ### clear() [Section titled “clear()”](#clear)
```ts
clear(): void;
```
Defined in: [src/model/meshObservations.ts:90](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L90) #### Returns [Section titled “Returns”](#returns-1) `void` *** ### consumeMatching() [Section titled “consumeMatching()”](#consumematching)
```ts
consumeMatching(channelHash, hashCount): MeshObservation[];
```
Defined in: [src/model/meshObservations.ts:59](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L59) Return (and remove) every observation matching `channelHash` and `hashCount`. When multiple distinct messages match (different `payloadFingerprint`), only the freshest fingerprint’s group is returned — that’s the cluster that most likely produced the channel msg the caller just received. #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------- | -------- | | `channelHash` | `number` | | `hashCount` | `number` | #### Returns [Section titled “Returns”](#returns-2) [`MeshObservation`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/meshobservation/)\[] *** ### record() [Section titled “record()”](#record)
```ts
record(obs): void;
```
Defined in: [src/model/meshObservations.ts:49](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L49) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------- | | `obs` | [`MeshObservation`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/meshobservation/) | #### Returns [Section titled “Returns”](#returns-3) `void` *** ### size() [Section titled “size()”](#size)
```ts
size(): number;
```
Defined in: [src/model/meshObservations.ts:86](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L86) #### Returns [Section titled “Returns”](#returns-4) `number`
# advTypeToKind
```ts
function advTypeToKind(type): ContactKind;
```
Defined in: [src/model/contacts.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L50) Map a MeshCore ADV\_TYPE byte (1 chat, 2 repeater, 3 room, 4 sensor) to the app’s ContactKind. Shared by the protocol contacts feature and the discovered-contact store so the mapping lives in exactly one place. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `type` | `number` | ## Returns [Section titled “Returns”](#returns) [`ContactKind`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/contactkind/)
# contactKindToAdvType
```ts
function contactKindToAdvType(kind): number;
```
Defined in: [src/model/contacts.ts:66](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L66) Inverse of [advTypeToKind](/meshcore-ts/api/andyshinn/namespaces/models/functions/advtypetokind/): map a ContactKind to the MeshCore ADV\_TYPE byte used in CMD\_ADD\_UPDATE\_CONTACT. Kept beside advTypeToKind so the two stay in lockstep (values mirror ADV\_TYPE in protocol/codes). ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------- | | `kind` | [`ContactKind`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/contactkind/) | ## Returns [Section titled “Returns”](#returns) `number`
# hashSizeFromOutPathLen
```ts
function hashSizeFromOutPathLen(outPathLen):
| PathHashSize
| undefined;
```
Defined in: [src/model/contacts.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L43) Bytes-per-hop for a contact’s stored path, derived from the same packed out\_path\_len byte (bits 7-6 + 1). Lets consumers split a learned out\_path into hops using the contact’s OWN hash size rather than assuming the radio’s current path-hash mode. 0xFF (OUT\_PATH\_UNKNOWN) → undefined (no path). ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------ | -------- | | `outPathLen` | `number` | ## Returns [Section titled “Returns”](#returns) \| [`PathHashSize`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/pathhashsize/) | `undefined`
# hasValidFix
```ts
function hasValidFix(c): c is Contact & { gpsLat: number; gpsLon: number };
```
Defined in: [src/model/types.ts:108](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L108) True iff the contact carries a usable WGS84 fix: both coords present, not the 0/0 “no GPS” sentinel, and within valid lat/lon ranges. Corrupt adverts can yield out-of-range coords — treat those as no fix. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ----------------------------------------------------------------------------- | | `c` | [`Contact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contact/) | ## Returns [Section titled “Returns”](#returns) `c is Contact & { gpsLat: number; gpsLon: number }`
# hopsFromOutPathLen
```ts
function hopsFromOutPathLen(outPathLen): number | undefined;
```
Defined in: [src/model/contacts.ts:35](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L35) Hops away, derived from a contact’s stored out\_path\_len. This is the packed MeshCore path-length byte, NOT a raw byte count: bits 5-0 hold the hop count and bits 7-6 hold hashSize-1 (see firmware Packet::setPathHashSizeAndCount / getPathByteLen). The real path occupies hops × hashSize bytes. So a direct 2-byte-mode contact stores 0x40 (hop count 0, hashSize 2) — its hop count is 0, not 64. 0xFF (OUT\_PATH\_UNKNOWN) means no path established yet → flood. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------ | -------- | | `outPathLen` | `number` | ## Returns [Section titled “Returns”](#returns) `number` | `undefined`
# AutoAddConfig
Defined in: [src/model/types.ts:228](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L228) ## Properties [Section titled “Properties”](#properties) ### chat [Section titled “chat”](#chat)
```ts
chat: boolean;
```
Defined in: [src/model/types.ts:230](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L230) *** ### maxHops [Section titled “maxHops”](#maxhops)
```ts
maxHops: number | null;
```
Defined in: [src/model/types.ts:237](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L237) App-side filter: drop adverts whose path has more hops than this. `null` = no limit. The radio doesn’t apply this; the companion does pre-upsert. *** ### mode [Section titled “mode”](#mode)
```ts
mode: AutoAddMode;
```
Defined in: [src/model/types.ts:229](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L229) *** ### overwriteOldest [Section titled “overwriteOldest”](#overwriteoldest)
```ts
overwriteOldest: boolean;
```
Defined in: [src/model/types.ts:234](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L234) *** ### radioMaxHops [Section titled “radioMaxHops”](#radiomaxhops)
```ts
radioMaxHops: number;
```
Defined in: [src/model/types.ts:239](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L239) Radio-side firmware autoadd\_max\_hops; 0 = no limit. Distinct from the app-side `maxHops` advert filter. *** ### repeater [Section titled “repeater”](#repeater)
```ts
repeater: boolean;
```
Defined in: [src/model/types.ts:231](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L231) *** ### room [Section titled “room”](#room)
```ts
room: boolean;
```
Defined in: [src/model/types.ts:232](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L232) *** ### sensor [Section titled “sensor”](#sensor)
```ts
sensor: boolean;
```
Defined in: [src/model/types.ts:233](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L233)
# Channel
Defined in: [src/model/types.ts:53](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L53) ## Properties [Section titled “Properties”](#properties) ### idx? [Section titled “idx?”](#idx)
```ts
optional idx?: number;
```
Defined in: [src/model/types.ts:62](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L62) Slot index on the radio (0..N). Set after the protocol session learns it via RESP\_CHANNEL\_INFO. Required for outbound CMD\_SEND\_CHAN\_TXT\_MSG and used to dispatch incoming RESP\_CHANNEL\_MSG\_RECV(\_V3) frames to the right channel. *** ### key [Section titled “key”](#key)
```ts
key: string;
```
Defined in: [src/model/types.ts:54](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L54) *** ### kind [Section titled “kind”](#kind)
```ts
kind: ChannelKind;
```
Defined in: [src/model/types.ts:56](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L56) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/types.ts:55](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L55) *** ### secretHex? [Section titled “secretHex?”](#secrethex)
```ts
optional secretHex?: string;
```
Defined in: [src/model/types.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L57)
# Contact
Defined in: [src/model/types.ts:69](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L69) ## Properties [Section titled “Properties”](#properties) ### favourite? [Section titled “favourite?”](#favourite)
```ts
optional favourite?: boolean;
```
Defined in: [src/model/types.ts:80](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L80) Radio-level favourite — maps to the firmware contact flag bit 0, which protects the contact from overwrite-oldest eviction. *** ### gpsLat? [Section titled “gpsLat?”](#gpslat)
```ts
optional gpsLat?: number;
```
Defined in: [src/model/types.ts:101](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L101) Last advertised position in WGS84 degrees. Both present together or both absent — a partial fix is never written. 0/0 from firmware is treated as absent (default for radios without a GPS module). *** ### gpsLon? [Section titled “gpsLon?”](#gpslon)
```ts
optional gpsLon?: number;
```
Defined in: [src/model/types.ts:102](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L102) *** ### hops? [Section titled “hops?”](#hops)
```ts
optional hops?: number;
```
Defined in: [src/model/types.ts:77](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L77) *** ### key [Section titled “key”](#key)
```ts
key: string;
```
Defined in: [src/model/types.ts:70](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L70) *** ### kind [Section titled “kind”](#kind)
```ts
kind: ContactKind;
```
Defined in: [src/model/types.ts:73](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L73) *** ### lastSeenMs? [Section titled “lastSeenMs?”](#lastseenms)
```ts
optional lastSeenMs?: number;
```
Defined in: [src/model/types.ts:74](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L74) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/types.ts:72](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L72) *** ### outPathHashSize? [Section titled “outPathHashSize?”](#outpathhashsize)
```ts
optional outPathHashSize?: PathHashSize;
```
Defined in: [src/model/types.ts:88](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L88) Bytes per hop prefix (1, 2 or 4). Snapshot of the radio’s `path.hash.mode` at the time the path was captured / written. Needed to split `outPathHex` into the per-hop chips. *** ### outPathHex? [Section titled “outPathHex?”](#outpathhex)
```ts
optional outPathHex?: string;
```
Defined in: [src/model/types.ts:84](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L84) Hex-encoded out-path bytes (no separators) mirroring the firmware’s advert.out\_path. Empty / undefined means “flood” (no source-route). The byte length must be a multiple of `outPathHashSize`. *** ### pathLearnedAt? [Section titled “pathLearnedAt?”](#pathlearnedat)
```ts
optional pathLearnedAt?: number;
```
Defined in: [src/model/types.ts:97](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L97) Wall-clock ms of the most recent auto-learn that wrote `outPathHex`. *** ### pathManual? [Section titled “pathManual?”](#pathmanual)
```ts
optional pathManual?: boolean;
```
Defined in: [src/model/types.ts:95](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L95) True iff the current `outPathHex` was set by hand (not learned by the auto-retry pipeline). Drives the “overwrite manual path?” dialog. *** ### preferDirect? [Section titled “preferDirect?”](#preferdirect)
```ts
optional preferDirect?: boolean;
```
Defined in: [src/model/types.ts:92](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L92) When true, mesh routing is skipped entirely and the companion-side direct flow is used for this contact (CMD\_SEND\_LOGIN for repeaters; direct DM otherwise). Takes precedence over `outPathHex`. *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/model/types.ts:71](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L71) *** ### rssi? [Section titled “rssi?”](#rssi)
```ts
optional rssi?: number;
```
Defined in: [src/model/types.ts:75](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L75) *** ### snr? [Section titled “snr?”](#snr)
```ts
optional snr?: number;
```
Defined in: [src/model/types.ts:76](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L76)
# ContactRecord
Defined in: [src/model/contactTypes.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L5) ## Properties [Section titled “Properties”](#properties) ### flags [Section titled “flags”](#flags)
```ts
flags: number;
```
Defined in: [src/model/contactTypes.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L8) *** ### gpsLat [Section titled “gpsLat”](#gpslat)
```ts
gpsLat: number;
```
Defined in: [src/model/contactTypes.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L13) *** ### gpsLon [Section titled “gpsLon”](#gpslon)
```ts
gpsLon: number;
```
Defined in: [src/model/contactTypes.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L14) *** ### lastAdvertUnix [Section titled “lastAdvertUnix”](#lastadvertunix)
```ts
lastAdvertUnix: number;
```
Defined in: [src/model/contactTypes.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L12) *** ### lastmod [Section titled “lastmod”](#lastmod)
```ts
lastmod: number;
```
Defined in: [src/model/contactTypes.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L15) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/contactTypes.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L11) *** ### outPathHex [Section titled “outPathHex”](#outpathhex)
```ts
outPathHex: string;
```
Defined in: [src/model/contactTypes.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L10) *** ### outPathLen [Section titled “outPathLen”](#outpathlen)
```ts
outPathLen: number;
```
Defined in: [src/model/contactTypes.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L9) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/model/contactTypes.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L6) *** ### type [Section titled “type”](#type)
```ts
type: number;
```
Defined in: [src/model/contactTypes.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L7)
# DeviceCapabilities
Defined in: [src/model/types.ts:315](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L315) Per-tab “the device firmware doesn’t expose this over BLE” capability flags. Used to disable rows the official open-source protocol doesn’t define. ## Properties [Section titled “Properties”](#properties) ### identityKeyIO [Section titled “identityKeyIO”](#identitykeyio)
```ts
identityKeyIO: boolean;
```
Defined in: [src/model/types.ts:317](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L317) Firmware version ≥ 1.7.0 — required for CLI-based private key export. *** ### repeatMode [Section titled “repeatMode”](#repeatmode)
```ts
repeatMode: boolean;
```
Defined in: [src/model/types.ts:319](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L319) Firmware ver\_code ≥ 9 — repeat mode and client\_repeat byte.
# DeviceIdentity
Defined in: [src/model/types.ts:208](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L208) “Public info” the radio advertises about itself. Synced from RESP\_SELF\_INFO and mutated via CMD\_SET\_ADVERT\_NAME / CMD\_SET\_ADVERT\_LATLON / CMD\_SET\_OTHER\_PARAMS.advertLocationPolicy. ## Properties [Section titled “Properties”](#properties) ### lat [Section titled “lat”](#lat)
```ts
lat: number | null;
```
Defined in: [src/model/types.ts:211](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L211) *** ### lon [Section titled “lon”](#lon)
```ts
lon: number | null;
```
Defined in: [src/model/types.ts:212](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L212) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/types.ts:209](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L209) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/model/types.ts:210](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L210) *** ### sharePositionInAdvert [Section titled “sharePositionInAdvert”](#sharepositioninadvert)
```ts
sharePositionInAdvert: boolean;
```
Defined in: [src/model/types.ts:213](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L213)
# DeviceInfo
Defined in: [src/model/types.ts:281](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L281) Aggregate read-only device info. firmwareVerCode 0 means “unknown/no device connected” — consumers use that to gate firmware-version features (identity key export needs ≥ 1.7.0, repeat mode needs ≥9, etc.). ## Properties [Section titled “Properties”](#properties) ### batteryMv [Section titled “batteryMv”](#batterymv)
```ts
batteryMv: number;
```
Defined in: [src/model/types.ts:296](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L296) *** ### blePin [Section titled “blePin”](#blepin)
```ts
blePin: number;
```
Defined in: [src/model/types.ts:289](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L289) Device BLE pairing PIN; 0 = unset / random per session. *** ### channelsUsed [Section titled “channelsUsed”](#channelsused)
```ts
channelsUsed: number;
```
Defined in: [src/model/types.ts:292](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L292) *** ### contactsUsed [Section titled “contactsUsed”](#contactsused)
```ts
contactsUsed: number;
```
Defined in: [src/model/types.ts:293](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L293) *** ### deviceModel [Section titled “deviceModel”](#devicemodel)
```ts
deviceModel: string;
```
Defined in: [src/model/types.ts:283](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L283) *** ### firmwareBuildDate [Section titled “firmwareBuildDate”](#firmwarebuilddate)
```ts
firmwareBuildDate: string;
```
Defined in: [src/model/types.ts:287](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L287) Firmware build date string, e.g. “19 Apr 2026”. *** ### firmwareVerCode [Section titled “firmwareVerCode”](#firmwarevercode)
```ts
firmwareVerCode: number;
```
Defined in: [src/model/types.ts:282](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L282) *** ### firmwareVersion [Section titled “firmwareVersion”](#firmwareversion)
```ts
firmwareVersion: string;
```
Defined in: [src/model/types.ts:285](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L285) Human-readable firmware version, e.g. “v1.15.0” (distinct from firmwareVerCode). *** ### maxChannels [Section titled “maxChannels”](#maxchannels)
```ts
maxChannels: number;
```
Defined in: [src/model/types.ts:291](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L291) *** ### maxContacts [Section titled “maxContacts”](#maxcontacts)
```ts
maxContacts: number;
```
Defined in: [src/model/types.ts:290](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L290) *** ### storageTotalKb [Section titled “storageTotalKb”](#storagetotalkb)
```ts
storageTotalKb: number;
```
Defined in: [src/model/types.ts:295](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L295) *** ### storageUsedKb [Section titled “storageUsedKb”](#storageusedkb)
```ts
storageUsedKb: number;
```
Defined in: [src/model/types.ts:294](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L294)
# DiscoveredContact
Defined in: [src/model/contacts.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L5) A node we’ve heard an advert from. Superset of the on-radio contact list: `onRadio` marks whether it is currently committed to the radio’s store. ## Properties [Section titled “Properties”](#properties) ### favourite [Section titled “favourite”](#favourite)
```ts
favourite: boolean;
```
Defined in: [src/model/contacts.ts:26](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L26) *** ### firstHeardMs [Section titled “firstHeardMs”](#firstheardms)
```ts
firstHeardMs: number;
```
Defined in: [src/model/contacts.ts:24](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L24) First time WE heard this pubkey (our clock), ms. Tracked app-side. *** ### gpsLat? [Section titled “gpsLat?”](#gpslat)
```ts
optional gpsLat?: number;
```
Defined in: [src/model/contacts.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L13) *** ### gpsLon? [Section titled “gpsLon?”](#gpslon)
```ts
optional gpsLon?: number;
```
Defined in: [src/model/contacts.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L14) *** ### hops? [Section titled “hops?”](#hops)
```ts
optional hops?: number;
```
Defined in: [src/model/contacts.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L10) *** ### key [Section titled “key”](#key)
```ts
key: string;
```
Defined in: [src/model/contacts.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L6) *** ### kind [Section titled “kind”](#kind)
```ts
kind: ContactKind;
```
Defined in: [src/model/contacts.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L9) *** ### lastAdvertMs? [Section titled “lastAdvertMs?”](#lastadvertms)
```ts
optional lastAdvertMs?: number;
```
Defined in: [src/model/contacts.ts:18](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L18) Last advert time stamped by the NODE’s own clock, ms. Unreliable — a node with a wrong RTC can report a time in the future or far past. Shown as the secondary “advertised” timestamp, never used for the “last heard” sort. *** ### lastHeardMs? [Section titled “lastHeardMs?”](#lastheardms)
```ts
optional lastHeardMs?: number;
```
Defined in: [src/model/contacts.ts:22](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L22) Last time WE actually heard a live advert (our clock), ms. Set only on a real PUSH\_NEW\_ADVERT, never on a GET\_CONTACTS resync — so committing a contact to the radio doesn’t bump it. Undefined until first live advert. *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/contacts.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L8) *** ### onRadio [Section titled “onRadio”](#onradio)
```ts
onRadio: boolean;
```
Defined in: [src/model/contacts.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L25) *** ### outPathHashSize? [Section titled “outPathHashSize?”](#outpathhashsize)
```ts
optional outPathHashSize?: PathHashSize;
```
Defined in: [src/model/contacts.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L12) *** ### outPathHex? [Section titled “outPathHex?”](#outpathhex)
```ts
optional outPathHex?: string;
```
Defined in: [src/model/contacts.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L11) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/model/contacts.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contacts.ts#L7)
# GpsConfig
Defined in: [src/model/types.ts:269](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L269) GPS module config exchanged via CMD\_SET\_CUSTOM\_VAR(“gps:1”/“gps\_interval:N”). ## Properties [Section titled “Properties”](#properties) ### enabled [Section titled “enabled”](#enabled)
```ts
enabled: boolean;
```
Defined in: [src/model/types.ts:270](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L270) *** ### intervalSec [Section titled “intervalSec”](#intervalsec)
```ts
intervalSec: number;
```
Defined in: [src/model/types.ts:271](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L271)
# MeshObservation
Defined in: [src/model/meshObservations.ts:21](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L21) ## Properties [Section titled “Properties”](#properties) ### channelHash [Section titled “channelHash”](#channelhash)
```ts
channelHash: number;
```
Defined in: [src/model/meshObservations.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L25) First byte of sha256(channel.secret) — present on GRP\_TXT/GRP\_DATA in the payload’s first byte. Used to filter matches to the right channel. *** ### finalSnr [Section titled “finalSnr”](#finalsnr)
```ts
finalSnr: number;
```
Defined in: [src/model/meshObservations.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L29) *** ### hashCount [Section titled “hashCount”](#hashcount)
```ts
hashCount: number;
```
Defined in: [src/model/meshObservations.ts:27](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L27) *** ### hashSize [Section titled “hashSize”](#hashsize)
```ts
hashSize: number;
```
Defined in: [src/model/meshObservations.ts:26](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L26) *** ### pathHex [Section titled “pathHex”](#pathhex)
```ts
pathHex: string;
```
Defined in: [src/model/meshObservations.ts:28](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L28) *** ### payloadFingerprint [Section titled “payloadFingerprint”](#payloadfingerprint)
```ts
payloadFingerprint: string;
```
Defined in: [src/model/meshObservations.ts:34](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L34) Hash of the encrypted payload bytes (everything after the channel\_hash byte). Identical across multi-path receipts of the same message, so the lookup can also disambiguate when two channel msgs collide in the same window with the same hop count. *** ### recordedAt [Section titled “recordedAt”](#recordedat)
```ts
recordedAt: number;
```
Defined in: [src/model/meshObservations.ts:22](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/meshObservations.ts#L22)
# Message
Defined in: [src/model/types.ts:163](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L163) ## Properties [Section titled “Properties”](#properties) ### body [Section titled “body”](#body)
```ts
body: string;
```
Defined in: [src/model/types.ts:167](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L167) *** ### fromPublicKeyHex? [Section titled “fromPublicKeyHex?”](#frompublickeyhex)
```ts
optional fromPublicKeyHex?: string;
```
Defined in: [src/model/types.ts:166](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L166) *** ### id [Section titled “id”](#id)
```ts
id: string;
```
Defined in: [src/model/types.ts:164](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L164) *** ### key [Section titled “key”](#key)
```ts
key: string;
```
Defined in: [src/model/types.ts:165](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L165) *** ### meta? [Section titled “meta?”](#meta)
```ts
optional meta?: MessageMeta;
```
Defined in: [src/model/types.ts:170](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L170) *** ### state [Section titled “state”](#state)
```ts
state: MessageState;
```
Defined in: [src/model/types.ts:169](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L169) *** ### ts [Section titled “ts”](#ts)
```ts
ts: number;
```
Defined in: [src/model/types.ts:168](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L168)
# MessageHop
Defined in: [src/model/types.ts:129](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L129) ## Properties [Section titled “Properties”](#properties) ### kind [Section titled “kind”](#kind)
```ts
kind: MessageHopKind;
```
Defined in: [src/model/types.ts:130](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L130) *** ### name? [Section titled “name?”](#name)
```ts
optional name?: string | null;
```
Defined in: [src/model/types.ts:132](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L132) *** ### pk? [Section titled “pk?”](#pk)
```ts
optional pk?: string | null;
```
Defined in: [src/model/types.ts:133](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L133) *** ### shortId [Section titled “shortId”](#shortid)
```ts
shortId: string;
```
Defined in: [src/model/types.ts:131](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L131) *** ### unnamed? [Section titled “unnamed?”](#unnamed)
```ts
optional unnamed?: boolean;
```
Defined in: [src/model/types.ts:134](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L134)
# MessageMeta
Defined in: [src/model/types.ts:150](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L150) ## Properties [Section titled “Properties”](#properties) ### hops? [Section titled “hops?”](#hops)
```ts
optional hops?: number;
```
Defined in: [src/model/types.ts:151](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L151) *** ### paths? [Section titled “paths?”](#paths)
```ts
optional paths?: MessagePath[];
```
Defined in: [src/model/types.ts:156](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L156) Decoded route(s) the message travelled, populated when a matching mesh observation (PUSH\_CODE\_LOG\_RX\_DATA 0x88) preceded the channel-msg push. *** ### rssi? [Section titled “rssi?”](#rssi)
```ts
optional rssi?: number;
```
Defined in: [src/model/types.ts:152](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L152) *** ### signatureHex? [Section titled “signatureHex?”](#signaturehex)
```ts
optional signatureHex?: string;
```
Defined in: [src/model/types.ts:160](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L160) *** ### snr? [Section titled “snr?”](#snr)
```ts
optional snr?: number;
```
Defined in: [src/model/types.ts:153](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L153) *** ### timesHeard? [Section titled “timesHeard?”](#timesheard)
```ts
optional timesHeard?: number;
```
Defined in: [src/model/types.ts:159](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L159) Number of distinct flood receptions merged into this Message row. Absent ⇒ treat as 1. Bumped on collision.
# MessagePath
Defined in: [src/model/types.ts:143](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L143) One observed reception of a flood message: the sequence of hops it took from origin to our radio. A single Message can carry multiple paths when the same packet arrived via multiple flood routes (merged on receipt by deterministic id). `hashMode` is the firmware-encoded per-hop hash byte count (1, 2, or 3 — 4 is reserved). `finalSnr` is the SNR our radio measured on the LAST hop only; per-hop SNR is never available on flood. ## Properties [Section titled “Properties”](#properties) ### finalSnr [Section titled “finalSnr”](#finalsnr)
```ts
finalSnr: number;
```
Defined in: [src/model/types.ts:147](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L147) *** ### hashMode [Section titled “hashMode”](#hashmode)
```ts
hashMode: number;
```
Defined in: [src/model/types.ts:146](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L146) *** ### hops [Section titled “hops”](#hops)
```ts
hops: MessageHop[];
```
Defined in: [src/model/types.ts:145](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L145) *** ### id [Section titled “id”](#id)
```ts
id: string;
```
Defined in: [src/model/types.ts:144](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L144)
# Owner
Defined in: [src/model/types.ts:173](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L173) ## Properties [Section titled “Properties”](#properties) ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/model/types.ts:174](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L174) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/model/types.ts:175](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L175) *** ### publicKeyShort [Section titled “publicKeyShort”](#publickeyshort)
```ts
publicKeyShort: string;
```
Defined in: [src/model/types.ts:176](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L176)
# PathLearnedEvent
Defined in: [src/model/types.ts:350](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L350) ## Properties [Section titled “Properties”](#properties) ### contactKey [Section titled “contactKey”](#contactkey)
```ts
contactKey: string;
```
Defined in: [src/model/types.ts:351](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L351) *** ### learnedAt [Section titled “learnedAt”](#learnedat)
```ts
learnedAt: number;
```
Defined in: [src/model/types.ts:363](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L363) Wall-clock ms of the learn event. *** ### newOutPathHashSize [Section titled “newOutPathHashSize”](#newoutpathhashsize)
```ts
newOutPathHashSize: PathHashSize;
```
Defined in: [src/model/types.ts:356](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L356) *** ### newOutPathHex [Section titled “newOutPathHex”](#newoutpathhex)
```ts
newOutPathHex: string;
```
Defined in: [src/model/types.ts:355](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L355) New out-path bytes the radio observed when the send succeeded. May be empty (e.g. a path-known send fell back to flood and the radio still hasn’t a path it trusts). *** ### previousManual [Section titled “previousManual”](#previousmanual)
```ts
previousManual: boolean;
```
Defined in: [src/model/types.ts:361](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L361) True iff the previous path was set manually — used to decide whether to prompt or apply silently. *** ### previousOutPathHex [Section titled “previousOutPathHex”](#previousoutpathhex)
```ts
previousOutPathHex: string;
```
Defined in: [src/model/types.ts:358](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L358) Path that was on the contact immediately before the learn.
# RadioSettings
Defined in: [src/model/types.ts:179](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L179) ## Properties [Section titled “Properties”](#properties) ### bandwidthHz [Section titled “bandwidthHz”](#bandwidthhz)
```ts
bandwidthHz: number;
```
Defined in: [src/model/types.ts:181](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L181) *** ### codingRate [Section titled “codingRate”](#codingrate)
```ts
codingRate: number;
```
Defined in: [src/model/types.ts:183](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L183) *** ### frequencyHz [Section titled “frequencyHz”](#frequencyhz)
```ts
frequencyHz: number;
```
Defined in: [src/model/types.ts:180](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L180) *** ### pathHashMode [Section titled “pathHashMode”](#pathhashmode)
```ts
pathHashMode: PathHashSize;
```
Defined in: [src/model/types.ts:189](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L189) Firmware `path.hash.mode` — bytes per hop prefix used when source-routing. All contacts whose path is captured / learned while this radio is connected inherit this as their `outPathHashSize` default. *** ### repeatMode [Section titled “repeatMode”](#repeatmode)
```ts
repeatMode: boolean;
```
Defined in: [src/model/types.ts:185](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L185) *** ### spreadingFactor [Section titled “spreadingFactor”](#spreadingfactor)
```ts
spreadingFactor: number;
```
Defined in: [src/model/types.ts:182](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L182) *** ### txPowerDbm [Section titled “txPowerDbm”](#txpowerdbm)
```ts
txPowerDbm: number;
```
Defined in: [src/model/types.ts:184](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L184)
# RawPacket
Defined in: [src/model/types.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L13) ## Properties [Section titled “Properties”](#properties) ### bytes [Section titled “bytes”](#bytes)
```ts
bytes: number[];
```
Defined in: [src/model/types.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L20) *** ### code? [Section titled “code?”](#code)
```ts
optional code?: number;
```
Defined in: [src/model/types.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L29) *** ### codeName? [Section titled “codeName?”](#codename)
```ts
optional codeName?: string;
```
Defined in: [src/model/types.ts:30](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L30) *** ### hex [Section titled “hex”](#hex)
```ts
hex: string;
```
Defined in: [src/model/types.ts:19](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L19) *** ### kind [Section titled “kind”](#kind)
```ts
kind: FrameKind;
```
Defined in: [src/model/types.ts:16](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L16) *** ### payloadBytes [Section titled “payloadBytes”](#payloadbytes)
```ts
payloadBytes: number[];
```
Defined in: [src/model/types.ts:24](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L24) *** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/model/types.ts:23](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L23) *** ### rssi? [Section titled “rssi?”](#rssi)
```ts
optional rssi?: number;
```
Defined in: [src/model/types.ts:27](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L27) *** ### snr? [Section titled “snr?”](#snr)
```ts
optional snr?: number;
```
Defined in: [src/model/types.ts:26](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L26) *** ### timestamp [Section titled “timestamp”](#timestamp)
```ts
timestamp: number;
```
Defined in: [src/model/types.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L14) *** ### transportType [Section titled “transportType”](#transporttype)
```ts
transportType: TransportType;
```
Defined in: [src/model/types.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L15)
# RepeaterStatusSnapshot
Defined in: [src/model/types.ts:330](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L330) Decoded admin-response payload surfaced from a repeater. `payloadHex` is always populated so raw bytes can be shown when decoding can’t make sense of them; `fields` is the best-effort decode (status: well-known firmware layout; telemetry: CayenneLPP). ## Properties [Section titled “Properties”](#properties) ### contactKey [Section titled “contactKey”](#contactkey)
```ts
contactKey: string;
```
Defined in: [src/model/types.ts:331](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L331) *** ### fields [Section titled “fields”](#fields)
```ts
fields: object[];
```
Defined in: [src/model/types.ts:334](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L334) #### name [Section titled “name”](#name)
```ts
name: string;
```
#### unit? [Section titled “unit?”](#unit)
```ts
optional unit?: string;
```
#### value [Section titled “value”](#value)
```ts
value: string | number;
```
*** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/model/types.ts:333](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L333) *** ### receivedAt [Section titled “receivedAt”](#receivedat)
```ts
receivedAt: number;
```
Defined in: [src/model/types.ts:332](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L332)
# RepeaterTelemetrySnapshot
Defined in: [src/model/types.ts:337](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L337) ## Properties [Section titled “Properties”](#properties) ### contactKey [Section titled “contactKey”](#contactkey)
```ts
contactKey: string;
```
Defined in: [src/model/types.ts:338](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L338) *** ### fields [Section titled “fields”](#fields)
```ts
fields: object[];
```
Defined in: [src/model/types.ts:341](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L341) #### channel [Section titled “channel”](#channel)
```ts
channel: number;
```
#### name [Section titled “name”](#name)
```ts
name: string;
```
#### typeHex [Section titled “typeHex”](#typehex)
```ts
typeHex: string;
```
#### unit? [Section titled “unit?”](#unit)
```ts
optional unit?: string;
```
#### value [Section titled “value”](#value)
```ts
value: string | number;
```
*** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/model/types.ts:340](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L340) *** ### receivedAt [Section titled “receivedAt”](#receivedat)
```ts
receivedAt: number;
```
Defined in: [src/model/types.ts:339](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L339)
# SyncProgress
Defined in: [src/model/types.ts:39](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L39) ## Properties [Section titled “Properties”](#properties) ### channels [Section titled “channels”](#channels)
```ts
channels: object;
```
Defined in: [src/model/types.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L41) #### done [Section titled “done”](#done)
```ts
done: number;
```
#### total [Section titled “total”](#total)
```ts
total: number;
```
*** ### contacts [Section titled “contacts”](#contacts)
```ts
contacts: object;
```
Defined in: [src/model/types.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L42) #### done [Section titled “done”](#done-1)
```ts
done: number;
```
#### total [Section titled “total”](#total-1)
```ts
total: number;
```
*** ### phase [Section titled “phase”](#phase)
```ts
phase: SyncPhase;
```
Defined in: [src/model/types.ts:40](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L40)
# TelemetryPolicy
Defined in: [src/model/types.ts:255](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L255) Telemetry/messaging knobs from CMD\_SET\_OTHER\_PARAMS. Each telemetry mode is 0=deny, 1=allow-per-contact-flag, 2=allow-all. `multiAcks` is 0..2 typical; more ACKs increase reliability at the cost of airtime. ## Properties [Section titled “Properties”](#properties) ### base [Section titled “base”](#base)
```ts
base: 0 | 1 | 2;
```
Defined in: [src/model/types.ts:256](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L256) *** ### env [Section titled “env”](#env)
```ts
env: 0 | 1 | 2;
```
Defined in: [src/model/types.ts:258](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L258) *** ### loc [Section titled “loc”](#loc)
```ts
loc: 0 | 1 | 2;
```
Defined in: [src/model/types.ts:257](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L257) *** ### multiAcks [Section titled “multiAcks”](#multiacks)
```ts
multiAcks: number;
```
Defined in: [src/model/types.ts:259](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L259)
# AutoAddMode
```ts
type AutoAddMode = "all" | "selected";
```
Defined in: [src/model/types.ts:227](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L227) Auto-add behaviour (CMD\_SET\_AUTO\_ADD\_CONFIG / GET\_AUTO\_ADD\_CONFIG). `mode` is an app-side convenience: “all” forces all four kind flags true on save; “selected” respects the per-kind booleans. The radio flag byte only carries the kinds + overwrite\_oldest.
# ChannelKind
```ts
type ChannelKind = "public" | "hashtag" | "private";
```
Defined in: [src/model/types.ts:51](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L51)
# ContactKind
```ts
type ContactKind = "chat" | "repeater" | "sensor" | "room";
```
Defined in: [src/model/types.ts:65](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L65)
# ContactSource
```ts
type ContactSource = "sync" | "advert";
```
Defined in: [src/model/contactTypes.ts:21](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/contactTypes.ts#L21) Where an ingested contact was heard: `'sync'` (RESP\_CONTACT during the GET\_CONTACTS handshake — always on-radio) or `'advert'` (live PUSH\_NEW\_ADVERT — on-radio only if already in the store).
# FrameKind
```ts
type FrameKind = "mesh" | "companion";
```
Defined in: [src/model/types.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L11) Coarse frame classification: a literal mesh packet vs. a companion-radio event/response. Mirrors the discriminant on the frame parser’s ParsedFrame.
# MessageHopKind
```ts
type MessageHopKind = "origin" | "hop" | "sink";
```
Defined in: [src/model/types.ts:128](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L128) One node in a routing path. `kind` distinguishes the message originator (sender, derived from the “name: ” prefix in channel messages), intermediate repeaters, and the sink (our radio). `shortId` is the per-hop prefix hex (1, 2, or 3 bytes wide) as encoded by the firmware in the on-air path. `unnamed: true` means we only know the prefix byte(s) — no advert ever seen for that prefix.
# MessageState
```ts
type MessageState = "sending" | "sent" | "heard" | "ack" | "failed" | "received";
```
Defined in: [src/model/types.ts:120](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L120)
# PathHashSize
```ts
type PathHashSize = 1 | 2 | 3;
```
Defined in: [src/model/types.ts:67](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L67)
# SyncPhase
```ts
type SyncPhase = "idle" | "syncing" | "done";
```
Defined in: [src/model/types.ts:38](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L38) Post-connect handshake progress. `phase` is the high-level state surfaced alongside the transport-level state; the per-bucket counters for channels and contacts are summed to drive a “Syncing N/M” indicator. `idle` = not currently syncing (either pre-connect or post-completion); `syncing` = handshake in flight; `done` = handshake finished this session.
# TransportState
```ts
type TransportState = "idle" | "scanning" | "connecting" | "connected" | "error";
```
Defined in: [src/model/types.ts:4](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L4)
# TransportType
```ts
type TransportType = "ble" | "serial";
```
Defined in: [src/model/types.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L7) Which physical transport carried a frame.
# DEFAULT_AUTO_ADD_CONFIG
```ts
const DEFAULT_AUTO_ADD_CONFIG: AutoAddConfig;
```
Defined in: [src/model/types.ts:241](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L241)
# DEFAULT_DEVICE_CAPABILITIES
```ts
const DEFAULT_DEVICE_CAPABILITIES: DeviceCapabilities;
```
Defined in: [src/model/types.ts:321](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L321)
# DEFAULT_DEVICE_IDENTITY
```ts
const DEFAULT_DEVICE_IDENTITY: DeviceIdentity;
```
Defined in: [src/model/types.ts:215](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L215)
# DEFAULT_DEVICE_INFO
```ts
const DEFAULT_DEVICE_INFO: DeviceInfo;
```
Defined in: [src/model/types.ts:298](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L298)
# DEFAULT_GPS_CONFIG
```ts
const DEFAULT_GPS_CONFIG: GpsConfig;
```
Defined in: [src/model/types.ts:273](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L273)
# DEFAULT_RADIO_SETTINGS
```ts
const DEFAULT_RADIO_SETTINGS: RadioSettings;
```
Defined in: [src/model/types.ts:193](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L193)
# DEFAULT_SYNC_PROGRESS
```ts
const DEFAULT_SYNC_PROGRESS: SyncProgress;
```
Defined in: [src/model/types.ts:45](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L45)
# DEFAULT_TELEMETRY_POLICY
```ts
const DEFAULT_TELEMETRY_POLICY: TelemetryPolicy;
```
Defined in: [src/model/types.ts:261](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/model/types.ts#L261)
# Events
Defined in: [src/ports/events.ts:127](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L127) Typed wrapper around `node:events` EventEmitter. Public method signatures are fully typed against [MeshCoreEventMap](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/); the untyped `node:events` boundary is bridged with a single localized cast in each method. ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new Events(): MeshCoreEvents;
```
Defined in: [src/ports/events.ts:130](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L130) #### Returns [Section titled “Returns”](#returns) `MeshCoreEvents` ## Methods [Section titled “Methods”](#methods) ### emit() [Section titled “emit()”](#emit)
```ts
emit(event, ...args): void;
```
Defined in: [src/ports/events.ts:151](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L151) #### Type Parameters [Section titled “Type Parameters”](#type-parameters) | Type Parameter | | -------------------------------------------------------------------------------------------------- | | `K` *extends* keyof [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/) | #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------------------------------------------------------------------------------------------------- | | `event` | `K` | | …`args` | `Parameters`<[`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/)\[`K`]> | #### Returns [Section titled “Returns”](#returns-1) `void` *** ### off() [Section titled “off()”](#off)
```ts
off(event, listener): this;
```
Defined in: [src/ports/events.ts:141](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L141) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-1) | Type Parameter | | -------------------------------------------------------------------------------------------------- | | `K` *extends* keyof [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/) | #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | ---------- | ------------------------------------------------------------------------------------ | | `event` | `K` | | `listener` | [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/)\[`K`] | #### Returns [Section titled “Returns”](#returns-2) `this` *** ### on() [Section titled “on()”](#on)
```ts
on(event, listener): this;
```
Defined in: [src/ports/events.ts:136](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L136) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-2) | Type Parameter | | -------------------------------------------------------------------------------------------------- | | `K` *extends* keyof [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/) | #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ---------- | ------------------------------------------------------------------------------------ | | `event` | `K` | | `listener` | [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/)\[`K`] | #### Returns [Section titled “Returns”](#returns-3) `this` *** ### once() [Section titled “once()”](#once)
```ts
once(event, listener): this;
```
Defined in: [src/ports/events.ts:146](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L146) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-3) | Type Parameter | | -------------------------------------------------------------------------------------------------- | | `K` *extends* keyof [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/) | #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | ---------- | ------------------------------------------------------------------------------------ | | `event` | `K` | | `listener` | [`EventMap`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/)\[`K`] | #### Returns [Section titled “Returns”](#returns-4) `this` *** ### removeAllListeners() [Section titled “removeAllListeners()”](#removealllisteners)
```ts
removeAllListeners(): this;
```
Defined in: [src/ports/events.ts:155](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L155) #### Returns [Section titled “Returns”](#returns-5) `this`
# EventMap
Defined in: [src/ports/events.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L37) Strongly-typed map of every event the library emits. The session owns a `MeshCoreEvents` instance and exposes it as `session.events`. Note: there is intentionally NO generic `error` event here — the donor app’s `errorMessage` channel was dropped during extraction. Specific recoverable conditions are surfaced as their own dedicated events instead (e.g. [MeshCoreEventMap.contactsFull](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/#contactsfull)), which adapters may map onto their own error/toast channel. ## Properties [Section titled “Properties”](#properties) ### autoAddConfig [Section titled “autoAddConfig”](#autoaddconfig)
```ts
autoAddConfig: (cfg) => void;
```
Defined in: [src/ports/events.ts:70](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L70) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------- | | `cfg` | [`AutoAddConfig`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/autoaddconfig/) | #### Returns [Section titled “Returns”](#returns) `void` *** ### channelPresence [Section titled “channelPresence”](#channelpresence)
```ts
channelPresence: (keys) => void;
```
Defined in: [src/ports/events.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L41) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ----------- | | `keys` | `string`\[] | #### Returns [Section titled “Returns”](#returns-1) `void` *** ### channels [Section titled “channels”](#channels)
```ts
channels: (channels) => void;
```
Defined in: [src/ports/events.ts:40](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L40) #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | ---------- | -------------------------------------------------------------------------------- | | `channels` | [`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/)\[] | #### Returns [Section titled “Returns”](#returns-2) `void` *** ### contactDiscovered [Section titled “contactDiscovered”](#contactdiscovered)
```ts
contactDiscovered: (c) => void;
```
Defined in: [src/ports/events.ts:51](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L51) #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `c` | { `key`: `string`; `kind`: [`ContactKind`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/contactkind/); `name`: `string`; } | | `c.key` | `string` | | `c.kind` | [`ContactKind`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/contactkind/) | | `c.name` | `string` | #### Returns [Section titled “Returns”](#returns-3) `void` *** ### contactEvicted [Section titled “contactEvicted”](#contactevicted)
```ts
contactEvicted: (name) => void;
```
Defined in: [src/ports/events.ts:45](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L45) #### Parameters [Section titled “Parameters”](#parameters-4) | Parameter | Type | | --------- | -------- | | `name` | `string` | #### Returns [Section titled “Returns”](#returns-4) `void` *** ### contactObserved [Section titled “contactObserved”](#contactobserved)
```ts
contactObserved: (record, source) => void;
```
Defined in: [src/ports/events.ts:54](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L54) Fires whenever a contact record is ingested (sync or advert), exposing the raw decoded record so consumers can persist it themselves. #### Parameters [Section titled “Parameters”](#parameters-5) | Parameter | Type | | --------- | ------------------------------------------------------------------------------------------- | | `record` | [`ContactRecord`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contactrecord/) | | `source` | [`ContactSource`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/contactsource/) | #### Returns [Section titled “Returns”](#returns-5) `void` *** ### contacts [Section titled “contacts”](#contacts)
```ts
contacts: (contacts) => void;
```
Defined in: [src/ports/events.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L43) #### Parameters [Section titled “Parameters”](#parameters-6) | Parameter | Type | | ---------- | -------------------------------------------------------------------------------- | | `contacts` | [`Contact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contact/)\[] | #### Returns [Section titled “Returns”](#returns-6) `void` *** ### contactsFull [Section titled “contactsFull”](#contactsfull)
```ts
contactsFull: () => void;
```
Defined in: [src/ports/events.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L50) The radio’s contact store is full — a new advert could not be auto-added (overwrite-oldest off, or all slots favourited). Informational/recoverable: the user must remove or favourite contacts to make room. Adapters may bridge this onto their own error/toast channel. #### Returns [Section titled “Returns”](#returns-7) `void` *** ### deviceCapabilities [Section titled “deviceCapabilities”](#devicecapabilities)
```ts
deviceCapabilities: (caps) => void;
```
Defined in: [src/ports/events.ts:74](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L74) #### Parameters [Section titled “Parameters”](#parameters-7) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------------- | | `caps` | [`DeviceCapabilities`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/devicecapabilities/) | #### Returns [Section titled “Returns”](#returns-8) `void` *** ### deviceIdentity [Section titled “deviceIdentity”](#deviceidentity)
```ts
deviceIdentity: (identity) => void;
```
Defined in: [src/ports/events.ts:69](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L69) #### Parameters [Section titled “Parameters”](#parameters-8) | Parameter | Type | | ---------- | ------------------------------------------------------------------------------------------- | | `identity` | [`DeviceIdentity`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/deviceidentity/) | #### Returns [Section titled “Returns”](#returns-9) `void` *** ### deviceInfo [Section titled “deviceInfo”](#deviceinfo)
```ts
deviceInfo: (info) => void;
```
Defined in: [src/ports/events.ts:73](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L73) #### Parameters [Section titled “Parameters”](#parameters-9) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------- | | `info` | [`DeviceInfo`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/deviceinfo/) | #### Returns [Section titled “Returns”](#returns-10) `void` *** ### discovered [Section titled “discovered”](#discovered)
```ts
discovered: (rows) => void;
```
Defined in: [src/ports/events.ts:44](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L44) #### Parameters [Section titled “Parameters”](#parameters-10) | Parameter | Type | | --------- | ---------------------------------------------------------------------------------------------------- | | `rows` | [`DiscoveredContact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/discoveredcontact/)\[] | #### Returns [Section titled “Returns”](#returns-11) `void` *** ### gpsConfig [Section titled “gpsConfig”](#gpsconfig)
```ts
gpsConfig: (cfg) => void;
```
Defined in: [src/ports/events.ts:72](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L72) #### Parameters [Section titled “Parameters”](#parameters-11) | Parameter | Type | | --------- | --------------------------------------------------------------------------------- | | `cfg` | [`GpsConfig`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/gpsconfig/) | #### Returns [Section titled “Returns”](#returns-12) `void` *** ### messagePathHeard [Section titled “messagePathHeard”](#messagepathheard)
```ts
messagePathHeard: (p) => void;
```
Defined in: [src/ports/events.ts:63](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L63) A heard repeater relay of one of your outgoing channel sends, correlated back to the message id you passed to registerChannelSend. Carries only the message id and the observed path — the library does not track message state for this; the consumer owns it. #### Parameters [Section titled “Parameters”](#parameters-12) | Parameter | Type | | --------- | ------------------------------------------------------------------------------------------------------------------ | | `p` | { `id`: `string`; `path`: [`MessagePath`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/messagepath/); } | | `p.id` | `string` | | `p.path` | [`MessagePath`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/messagepath/) | #### Returns [Section titled “Returns”](#returns-13) `void` *** ### messages [Section titled “messages”](#messages)
```ts
messages: (key, messages) => void;
```
Defined in: [src/ports/events.ts:55](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L55) #### Parameters [Section titled “Parameters”](#parameters-13) | Parameter | Type | | ---------- | -------------------------------------------------------------------------------- | | `key` | `string` | | `messages` | [`Message`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/message/)\[] | #### Returns [Section titled “Returns”](#returns-14) `void` *** ### messageState [Section titled “messageState”](#messagestate)
```ts
messageState: (id, state) => void;
```
Defined in: [src/ports/events.ts:58](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L58) #### Parameters [Section titled “Parameters”](#parameters-14) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------- | | `id` | `string` | | `state` | [`MessageState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/messagestate/) | #### Returns [Section titled “Returns”](#returns-15) `void` *** ### messageUpserted [Section titled “messageUpserted”](#messageupserted)
```ts
messageUpserted: (message) => void;
```
Defined in: [src/ports/events.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L57) A single inserted/updated message — a delta companion to `messages`. #### Parameters [Section titled “Parameters”](#parameters-15) | Parameter | Type | | --------- | ----------------------------------------------------------------------------- | | `message` | [`Message`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/message/) | #### Returns [Section titled “Returns”](#returns-16) `void` *** ### owner [Section titled “owner”](#owner)
```ts
owner: (owner) => void;
```
Defined in: [src/ports/events.ts:64](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L64) #### Parameters [Section titled “Parameters”](#parameters-16) | Parameter | Type | | --------- | -------------------------------------------------------------------------------------- | | `owner` | \| [`Owner`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/owner/) \| `null` | #### Returns [Section titled “Returns”](#returns-17) `void` *** ### pathLearned [Section titled “pathLearned”](#pathlearned)
```ts
pathLearned: (event) => void;
```
Defined in: [src/ports/events.ts:68](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L68) #### Parameters [Section titled “Parameters”](#parameters-17) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------------- | | `event` | [`PathLearnedEvent`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/pathlearnedevent/) | #### Returns [Section titled “Returns”](#returns-18) `void` *** ### radioSettings [Section titled “radioSettings”](#radiosettings)
```ts
radioSettings: (settings) => void;
```
Defined in: [src/ports/events.ts:65](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L65) #### Parameters [Section titled “Parameters”](#parameters-18) | Parameter | Type | | ---------- | ----------------------------------------------------------------------------------------- | | `settings` | [`RadioSettings`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/radiosettings/) | #### Returns [Section titled “Returns”](#returns-19) `void` *** ### rawPacket [Section titled “rawPacket”](#rawpacket)
```ts
rawPacket: (pkt) => void;
```
Defined in: [src/ports/events.ts:39](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L39) #### Parameters [Section titled “Parameters”](#parameters-19) | Parameter | Type | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `pkt` | { `hex`: `string`; `rssi`: `number`; `snr`: `number`; `source`: [`MeshSource`](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/meshsource/); } | | `pkt.hex` | `string` | | `pkt.rssi` | `number` | | `pkt.snr` | `number` | | `pkt.source` | [`MeshSource`](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/meshsource/) | #### Returns [Section titled “Returns”](#returns-20) `void` *** ### repeaterStatus [Section titled “repeaterStatus”](#repeaterstatus)
```ts
repeaterStatus: (snap) => void;
```
Defined in: [src/ports/events.ts:66](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L66) #### Parameters [Section titled “Parameters”](#parameters-20) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------------------------- | | `snap` | [`RepeaterStatusSnapshot`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/repeaterstatussnapshot/) | #### Returns [Section titled “Returns”](#returns-21) `void` *** ### repeaterTelemetry [Section titled “repeaterTelemetry”](#repeatertelemetry)
```ts
repeaterTelemetry: (snap) => void;
```
Defined in: [src/ports/events.ts:67](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L67) #### Parameters [Section titled “Parameters”](#parameters-21) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------------------------------- | | `snap` | [`RepeaterTelemetrySnapshot`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/repeatertelemetrysnapshot/) | #### Returns [Section titled “Returns”](#returns-22) `void` *** ### syncProgress [Section titled “syncProgress”](#syncprogress)
```ts
syncProgress: (progress) => void;
```
Defined in: [src/ports/events.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L42) #### Parameters [Section titled “Parameters”](#parameters-22) | Parameter | Type | | ---------- | --------------------------------------------------------------------------------------- | | `progress` | [`SyncProgress`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/syncprogress/) | #### Returns [Section titled “Returns”](#returns-23) `void` *** ### telemetryPolicy [Section titled “telemetryPolicy”](#telemetrypolicy)
```ts
telemetryPolicy: (policy) => void;
```
Defined in: [src/ports/events.ts:71](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L71) #### Parameters [Section titled “Parameters”](#parameters-23) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------- | | `policy` | [`TelemetryPolicy`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/telemetrypolicy/) | #### Returns [Section titled “Returns”](#returns-24) `void` *** ### transportState [Section titled “transportState”](#transportstate)
```ts
transportState: (s) => void;
```
Defined in: [src/ports/events.ts:38](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L38) #### Parameters [Section titled “Parameters”](#parameters-24) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------- | | `s` | [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) | #### Returns [Section titled “Returns”](#returns-25) `void`
# Logger
Defined in: [src/ports/logger.ts:2](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L2) Minimal structured logging port. Replaces the donor’s tslog `log.ts`. ## Methods [Section titled “Methods”](#methods) ### debug() [Section titled “debug()”](#debug)
```ts
debug(...args): void;
```
Defined in: [src/ports/logger.ts:4](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L4) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------ | | …`args` | `unknown`\[] | #### Returns [Section titled “Returns”](#returns) `void` *** ### error() [Section titled “error()”](#error)
```ts
error(...args): void;
```
Defined in: [src/ports/logger.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L7) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ------------ | | …`args` | `unknown`\[] | #### Returns [Section titled “Returns”](#returns-1) `void` *** ### info() [Section titled “info()”](#info)
```ts
info(...args): void;
```
Defined in: [src/ports/logger.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L5) #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ------------ | | …`args` | `unknown`\[] | #### Returns [Section titled “Returns”](#returns-2) `void` *** ### trace() [Section titled “trace()”](#trace)
```ts
trace(...args): void;
```
Defined in: [src/ports/logger.ts:3](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L3) #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | ------------ | | …`args` | `unknown`\[] | #### Returns [Section titled “Returns”](#returns-3) `void` *** ### warn() [Section titled “warn()”](#warn)
```ts
warn(...args): void;
```
Defined in: [src/ports/logger.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L6) #### Parameters [Section titled “Parameters”](#parameters-4) | Parameter | Type | | --------- | ------------ | | …`args` | `unknown`\[] | #### Returns [Section titled “Returns”](#returns-4) `void`
# Transport
Defined in: [src/ports/transport.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L5) Byte-stream port to the radio. The library injects an implementation (BLE, serial, etc.). ## Methods [Section titled “Methods”](#methods) ### getState() [Section titled “getState()”](#getstate)
```ts
getState(): TransportState;
```
Defined in: [src/ports/transport.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L11) #### Returns [Section titled “Returns”](#returns) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) *** ### onData() [Section titled “onData()”](#ondata)
```ts
onData(cb): void;
```
Defined in: [src/ports/transport.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L9) Each chunk is ONE complete companion frame (a BLE notification payload). #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------- | | `cb` | (`chunk`) => `void` | #### Returns [Section titled “Returns”](#returns-1) `void` *** ### onStateChange() [Section titled “onStateChange()”](#onstatechange)
```ts
onStateChange(cb): void;
```
Defined in: [src/ports/transport.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L10) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------- | | `cb` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-2) `void` *** ### send() [Section titled “send()”](#send)
```ts
send(bytes): Promise;
```
Defined in: [src/ports/transport.ts:7](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L7) Write one complete companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-3) `Promise`<`void`>
# EventName
```ts
type EventName = keyof EventMap;
```
Defined in: [src/ports/events.ts:82](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L82) Union of event-name keys (= `keyof MeshCoreEventMap`); interchangeable with `EventName` values.
# EventName
```ts
const EventName: object;
```
Defined in: [src/ports/events.ts:82](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/events.ts#L82) Named constants for every key in [MeshCoreEventMap](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/eventmap/), so consumers may subscribe by readable name instead of a bare string: `session.events.on(EventName.RAW_PACKET, …)`. Values equal the event keys, so the constant and the raw string are interchangeable and both infer the typed listener. `satisfies` validates each value; the guard below enforces coverage. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### AUTO\_ADD\_CONFIG [Section titled “AUTO\_ADD\_CONFIG”](#auto_add_config)
```ts
readonly AUTO_ADD_CONFIG: "autoAddConfig" = 'autoAddConfig';
```
### CHANNEL\_PRESENCE [Section titled “CHANNEL\_PRESENCE”](#channel_presence)
```ts
readonly CHANNEL_PRESENCE: "channelPresence" = 'channelPresence';
```
### CHANNELS [Section titled “CHANNELS”](#channels)
```ts
readonly CHANNELS: "channels" = 'channels';
```
### CONTACT\_DISCOVERED [Section titled “CONTACT\_DISCOVERED”](#contact_discovered)
```ts
readonly CONTACT_DISCOVERED: "contactDiscovered" = 'contactDiscovered';
```
### CONTACT\_EVICTED [Section titled “CONTACT\_EVICTED”](#contact_evicted)
```ts
readonly CONTACT_EVICTED: "contactEvicted" = 'contactEvicted';
```
### CONTACT\_OBSERVED [Section titled “CONTACT\_OBSERVED”](#contact_observed)
```ts
readonly CONTACT_OBSERVED: "contactObserved" = 'contactObserved';
```
### CONTACTS [Section titled “CONTACTS”](#contacts)
```ts
readonly CONTACTS: "contacts" = 'contacts';
```
### CONTACTS\_FULL [Section titled “CONTACTS\_FULL”](#contacts_full)
```ts
readonly CONTACTS_FULL: "contactsFull" = 'contactsFull';
```
### DEVICE\_CAPABILITIES [Section titled “DEVICE\_CAPABILITIES”](#device_capabilities)
```ts
readonly DEVICE_CAPABILITIES: "deviceCapabilities" = 'deviceCapabilities';
```
### DEVICE\_IDENTITY [Section titled “DEVICE\_IDENTITY”](#device_identity)
```ts
readonly DEVICE_IDENTITY: "deviceIdentity" = 'deviceIdentity';
```
### DEVICE\_INFO [Section titled “DEVICE\_INFO”](#device_info)
```ts
readonly DEVICE_INFO: "deviceInfo" = 'deviceInfo';
```
### DISCOVERED [Section titled “DISCOVERED”](#discovered)
```ts
readonly DISCOVERED: "discovered" = 'discovered';
```
### GPS\_CONFIG [Section titled “GPS\_CONFIG”](#gps_config)
```ts
readonly GPS_CONFIG: "gpsConfig" = 'gpsConfig';
```
### MESSAGE\_PATH\_HEARD [Section titled “MESSAGE\_PATH\_HEARD”](#message_path_heard)
```ts
readonly MESSAGE_PATH_HEARD: "messagePathHeard" = 'messagePathHeard';
```
### MESSAGE\_STATE [Section titled “MESSAGE\_STATE”](#message_state)
```ts
readonly MESSAGE_STATE: "messageState" = 'messageState';
```
### MESSAGE\_UPSERTED [Section titled “MESSAGE\_UPSERTED”](#message_upserted)
```ts
readonly MESSAGE_UPSERTED: "messageUpserted" = 'messageUpserted';
```
### MESSAGES [Section titled “MESSAGES”](#messages)
```ts
readonly MESSAGES: "messages" = 'messages';
```
### OWNER [Section titled “OWNER”](#owner)
```ts
readonly OWNER: "owner" = 'owner';
```
### PATH\_LEARNED [Section titled “PATH\_LEARNED”](#path_learned)
```ts
readonly PATH_LEARNED: "pathLearned" = 'pathLearned';
```
### RADIO\_SETTINGS [Section titled “RADIO\_SETTINGS”](#radio_settings)
```ts
readonly RADIO_SETTINGS: "radioSettings" = 'radioSettings';
```
### RAW\_PACKET [Section titled “RAW\_PACKET”](#raw_packet)
```ts
readonly RAW_PACKET: "rawPacket" = 'rawPacket';
```
### REPEATER\_STATUS [Section titled “REPEATER\_STATUS”](#repeater_status)
```ts
readonly REPEATER_STATUS: "repeaterStatus" = 'repeaterStatus';
```
### REPEATER\_TELEMETRY [Section titled “REPEATER\_TELEMETRY”](#repeater_telemetry)
```ts
readonly REPEATER_TELEMETRY: "repeaterTelemetry" = 'repeaterTelemetry';
```
### SYNC\_PROGRESS [Section titled “SYNC\_PROGRESS”](#sync_progress)
```ts
readonly SYNC_PROGRESS: "syncProgress" = 'syncProgress';
```
### TELEMETRY\_POLICY [Section titled “TELEMETRY\_POLICY”](#telemetry_policy)
```ts
readonly TELEMETRY_POLICY: "telemetryPolicy" = 'telemetryPolicy';
```
### TRANSPORT\_STATE [Section titled “TRANSPORT\_STATE”](#transport_state)
```ts
readonly TRANSPORT_STATE: "transportState" = 'transportState';
```
# noopLogger
```ts
const noopLogger: Logger;
```
Defined in: [src/ports/logger.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/logger.ts#L11) Default no-op logger so logging is entirely optional.
# BufferReader
Defined in: [src/protocol/buffer.ts:6](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L6) Cursor-based reader for MeshCore companion frames. Replaces hardcoded absolute offsets (e.g. `frame.readUInt32LE(132)`) so variable-length frames decode without off-by-one risk. Ported from meshcore.js’s BufferReader. ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new BufferReader(buf): BufferReader;
```
Defined in: [src/protocol/buffer.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L8) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `buf` | `Buffer` | #### Returns [Section titled “Returns”](#returns) `BufferReader` ## Accessors [Section titled “Accessors”](#accessors) ### remaining [Section titled “remaining”](#remaining) #### Get Signature [Section titled “Get Signature”](#get-signature)
```ts
get remaining(): number;
```
Defined in: [src/protocol/buffer.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L10) ##### Returns [Section titled “Returns”](#returns-1) `number` ## Methods [Section titled “Methods”](#methods) ### readByte() [Section titled “readByte()”](#readbyte)
```ts
readByte(): number;
```
Defined in: [src/protocol/buffer.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L14) #### Returns [Section titled “Returns”](#returns-2) `number` *** ### readBytes() [Section titled “readBytes()”](#readbytes)
```ts
readBytes(n): Buffer;
```
Defined in: [src/protocol/buffer.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L46) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | -------- | | `n` | `number` | #### Returns [Section titled “Returns”](#returns-3) `Buffer` *** ### readCString() [Section titled “readCString()”](#readcstring)
```ts
readCString(maxLen): string;
```
Defined in: [src/protocol/buffer.ts:62](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L62) Fixed-width null-padded string: consumes exactly `maxLen` bytes, returns the text up to the first null. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | -------- | | `maxLen` | `number` | #### Returns [Section titled “Returns”](#returns-4) `string` *** ### readInt16LE() [Section titled “readInt16LE()”](#readint16le)
```ts
readInt16LE(): number;
```
Defined in: [src/protocol/buffer.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L25) #### Returns [Section titled “Returns”](#returns-5) `number` *** ### readInt24BE() [Section titled “readInt24BE()”](#readint24be)
```ts
readInt24BE(): number;
```
Defined in: [src/protocol/buffer.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L41) 24-bit big-endian signed — used by CayenneLPP GPS fields. #### Returns [Section titled “Returns”](#returns-6) `number` *** ### readInt32LE() [Section titled “readInt32LE()”](#readint32le)
```ts
readInt32LE(): number;
```
Defined in: [src/protocol/buffer.ts:35](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L35) #### Returns [Section titled “Returns”](#returns-7) `number` *** ### readInt8() [Section titled “readInt8()”](#readint8)
```ts
readInt8(): number;
```
Defined in: [src/protocol/buffer.ts:17](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L17) #### Returns [Section titled “Returns”](#returns-8) `number` *** ### readRemaining() [Section titled “readRemaining()”](#readremaining)
```ts
readRemaining(): Buffer;
```
Defined in: [src/protocol/buffer.ts:54](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L54) #### Returns [Section titled “Returns”](#returns-9) `Buffer` *** ### readString() [Section titled “readString()”](#readstring)
```ts
readString(): string;
```
Defined in: [src/protocol/buffer.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L57) #### Returns [Section titled “Returns”](#returns-10) `string` *** ### readUInt16LE() [Section titled “readUInt16LE()”](#readuint16le)
```ts
readUInt16LE(): number;
```
Defined in: [src/protocol/buffer.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L20) #### Returns [Section titled “Returns”](#returns-11) `number` *** ### readUInt32LE() [Section titled “readUInt32LE()”](#readuint32le)
```ts
readUInt32LE(): number;
```
Defined in: [src/protocol/buffer.ts:30](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L30) #### Returns [Section titled “Returns”](#returns-12) `number`
# BufferWriter
Defined in: [src/protocol/buffer.ts:70](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L70) Cursor-based writer producing MeshCore companion frames. Methods chain. ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new BufferWriter(): BufferWriter;
```
#### Returns [Section titled “Returns”](#returns) `BufferWriter` ## Methods [Section titled “Methods”](#methods) ### toBuffer() [Section titled “toBuffer()”](#tobuffer)
```ts
toBuffer(): Buffer;
```
Defined in: [src/protocol/buffer.ts:109](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L109) #### Returns [Section titled “Returns”](#returns-1) `Buffer` *** ### writeByte() [Section titled “writeByte()”](#writebyte)
```ts
writeByte(b): this;
```
Defined in: [src/protocol/buffer.ts:73](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L73) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `b` | `number` | #### Returns [Section titled “Returns”](#returns-2) `this` *** ### writeBytes() [Section titled “writeBytes()”](#writebytes)
```ts
writeBytes(b): this;
```
Defined in: [src/protocol/buffer.ts:92](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L92) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------------------------------------------- | | `b` | `Buffer`<`ArrayBufferLike`> \| readonly `number`\[] | #### Returns [Section titled “Returns”](#returns-3) `this` *** ### writeCString() [Section titled “writeCString()”](#writecstring)
```ts
writeCString(s, maxLen): this;
```
Defined in: [src/protocol/buffer.ts:101](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L101) Fixed-width null-padded string: writes exactly `maxLen` bytes, always null-terminated (last byte forced to 0). #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | -------- | | `s` | `string` | | `maxLen` | `number` | #### Returns [Section titled “Returns”](#returns-4) `this` *** ### writeInt32LE() [Section titled “writeInt32LE()”](#writeint32le)
```ts
writeInt32LE(n): this;
```
Defined in: [src/protocol/buffer.ts:89](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L89) #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | -------- | | `n` | `number` | #### Returns [Section titled “Returns”](#returns-5) `this` *** ### writeInt8() [Section titled “writeInt8()”](#writeint8)
```ts
writeInt8(b): this;
```
Defined in: [src/protocol/buffer.ts:77](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L77) #### Parameters [Section titled “Parameters”](#parameters-4) | Parameter | Type | | --------- | -------- | | `b` | `number` | #### Returns [Section titled “Returns”](#returns-6) `this` *** ### writeString() [Section titled “writeString()”](#writestring)
```ts
writeString(s): this;
```
Defined in: [src/protocol/buffer.ts:96](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L96) #### Parameters [Section titled “Parameters”](#parameters-5) | Parameter | Type | | --------- | -------- | | `s` | `string` | #### Returns [Section titled “Returns”](#returns-7) `this` *** ### writeUInt16LE() [Section titled “writeUInt16LE()”](#writeuint16le)
```ts
writeUInt16LE(n): this;
```
Defined in: [src/protocol/buffer.ts:80](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L80) #### Parameters [Section titled “Parameters”](#parameters-6) | Parameter | Type | | --------- | -------- | | `n` | `number` | #### Returns [Section titled “Returns”](#returns-8) `this` *** ### writeUInt32LE() [Section titled “writeUInt32LE()”](#writeuint32le)
```ts
writeUInt32LE(n): this;
```
Defined in: [src/protocol/buffer.ts:84](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/buffer.ts#L84) #### Parameters [Section titled “Parameters”](#parameters-7) | Parameter | Type | | --------- | -------- | | `n` | `number` | #### Returns [Section titled “Returns”](#returns-9) `this`
# buildGetStats
```ts
function buildGetStats(subtype): Buffer;
```
Defined in: [src/protocol/repeater.ts:387](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L387) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ----------------- | | `subtype` | `0` \| `1` \| `2` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildLogout
```ts
function buildLogout(destPublicKeyHex): Buffer;
```
Defined in: [src/protocol/repeater.ts:347](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L347) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildReboot
```ts
function buildReboot(): Buffer;
```
Defined in: [src/protocol/encode.ts:16](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/encode.ts#L16) ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendAnonReq
```ts
function buildSendAnonReq(destPublicKeyHex, data): Buffer;
```
Defined in: [src/protocol/repeater.ts:359](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L359) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | | `data` | `Buffer` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendBinaryReq
```ts
function buildSendBinaryReq(destPublicKeyHex, reqData): Buffer;
```
Defined in: [src/protocol/repeater.ts:397](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L397) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | | `reqData` | `Buffer` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendLogin
```ts
function buildSendLogin(destPublicKeyHex, password): Buffer;
```
Defined in: [src/protocol/repeater.ts:336](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L336) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | | `password` | `string` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendSelfAdvert
```ts
function buildSendSelfAdvert(flood?): Buffer;
```
Defined in: [src/protocol/encode.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/encode.ts#L10) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | Default value | | --------- | --------- | ------------- | | `flood` | `boolean` | `true` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendStatusReq
```ts
function buildSendStatusReq(destPublicKeyHex): Buffer;
```
Defined in: [src/protocol/repeater.ts:312](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L312) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendTelemetryReq
```ts
function buildSendTelemetryReq(destPublicKeyHex): Buffer;
```
Defined in: [src/protocol/repeater.ts:324](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L324) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# buildSendTracePath
```ts
function buildSendTracePath(opts): Buffer;
```
Defined in: [src/protocol/repeater.ts:373](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L373) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------------- | -------------------------------------------------------------------------------- | | `opts` | { `authCode`: `number`; `flags?`: `number`; `path`: `Buffer`; `tag`: `number`; } | | `opts.authCode` | `number` | | `opts.flags?` | `number` | | `opts.path` | `Buffer` | | `opts.tag` | `number` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# decodeOnAirPacket
```ts
function decodeOnAirPacket(input): OnAirPacket;
```
Defined in: [src/protocol/onAirPackets.ts:69](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L69) Decode a full on-air mesh packet (header + path + payload) into a tagged union. Total — never throws; unparseable or unsupported input yields the `raw` fallback variant. Accepts a hex string or raw bytes. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------------------------------- | | `input` | `string` \| `Uint8Array`<`ArrayBufferLike`> | ## Returns [Section titled “Returns”](#returns) [`OnAirPacket`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/onairpacket/)
# getAnonReqTypeName
```ts
function getAnonReqTypeName(anonReqType): string;
```
Defined in: [src/protocol/codes.ts:387](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L387) Map an ANON\_REQ\_TYPE byte to its enum key name (e.g. 0x01 → ‘REGIONS’), or ‘UNKNOWN’ if unmapped. Note a leading 0 or ASCII byte (>= 0x20) is a password login rather than one of these query sub-types. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ------------- | -------- | | `anonReqType` | `number` | ## Returns [Section titled “Returns”](#returns) `string`
# getRequestTypeName
```ts
function getRequestTypeName(reqType): string;
```
Defined in: [src/protocol/codes.ts:380](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L380) Map a REQ\_TYPE byte to its enum key name (e.g. 0x05 → ‘GET\_ACCESS\_LIST’), or ‘UNKNOWN’ if unmapped. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `reqType` | `number` | ## Returns [Section titled “Returns”](#returns) `string`
# parseAclList
```ts
function parseAclList(payload): AclEntry[];
```
Defined in: [src/protocol/repeater.ts:146](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L146) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `payload` | `Buffer` | ## Returns [Section titled “Returns”](#returns) [`AclEntry`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/aclentry/)\[]
# parseAdvert
```ts
function parseAdvert(payload):
| Advert
| null;
```
Defined in: [src/protocol/advert.ts:93](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L93) Parse a raw advert payload (\[pubkey]\[timestamp]\[signature]\[app\_data]). ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `payload` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`Advert`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/advert/) | `null`
# parseAdvertAppData
```ts
function parseAdvertAppData(appData):
| AdvertAppData
| null;
```
Defined in: [src/protocol/advert.ts:59](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L59) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `appData` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`AdvertAppData`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/advertappdata/) | `null`
# parseAnonOwnerInfo
```ts
function parseAnonOwnerInfo(payload):
| OwnerInfo
| null;
```
Defined in: [src/protocol/repeater.ts:226](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L226) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `payload` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`OwnerInfo`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/ownerinfo/) | `null`
# parseAvgMinMax
```ts
function parseAvgMinMax(body):
| AvgMinMaxResult
| null;
```
Defined in: [src/protocol/repeater.ts:721](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L721) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `body` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`AvgMinMaxResult`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/avgminmaxresult/) | `null`
# parseBinaryResponse
```ts
function parseBinaryResponse(frame):
| BinaryResponse
| null;
```
Defined in: [src/protocol/repeater.ts:82](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L82) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`BinaryResponse`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/binaryresponse/) | `null`
# parseCompanionFrame
```ts
function parseCompanionFrame(frame):
| ParsedFrame
| null;
```
Defined in: [src/protocol/frame.ts:90](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/frame.ts#L90) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`ParsedFrame`](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/parsedframe/) | `null`
# parseContactBlob
```ts
function parseContactBlob(blob):
| Advert
| null;
```
Defined in: [src/protocol/advert.ts:121](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L121) Parse an export/import contact blob — a mesh Packet wrapping an advert — returning the advert, or null when it isn’t a well-formed advert packet. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `blob` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`Advert`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/advert/) | `null`
# parseLocalStats
```ts
function parseLocalStats(frame):
| LocalStats
| null;
```
Defined in: [src/protocol/repeater.ts:268](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L268) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`LocalStats`](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/localstats/) | `null`
# parseLoginFail
```ts
function parseLoginFail(frame):
| LoginFail
| null;
```
Defined in: [src/protocol/repeater.ts:51](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L51) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`LoginFail`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/loginfail/) | `null`
# parseLoginSuccess
```ts
function parseLoginSuccess(frame):
| LoginSuccess
| null;
```
Defined in: [src/protocol/repeater.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L20) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`LoginSuccess`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/loginsuccess/) | `null`
# parseMeshPacket
```ts
function parseMeshPacket(bytes):
| MeshPacketHeader
| null;
```
Defined in: [src/protocol/meshPacket.ts:63](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L63) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `bytes` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`MeshPacketHeader`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/meshpacketheader/) | `null`
# parseNeighbours
```ts
function parseNeighbours(payload, prefixLen):
| NeighboursPage
| null;
```
Defined in: [src/protocol/repeater.ts:177](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L177) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | ----------- | -------- | | `payload` | `Buffer` | | `prefixLen` | `number` | ## Returns [Section titled “Returns”](#returns) \| [`NeighboursPage`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/neighbourspage/) | `null`
# parseOwnerInfo
```ts
function parseOwnerInfo(payload): OwnerInfo;
```
Defined in: [src/protocol/repeater.ts:205](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L205) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `payload` | `Buffer` | ## Returns [Section titled “Returns”](#returns) [`OwnerInfo`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/ownerinfo/)
# parsePublicKey
```ts
function parsePublicKey(publicKeyHex, label): Buffer;
```
Defined in: [src/protocol/pubkey.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/pubkey.ts#L14) Decode a full 32-byte public key from hex, rejecting anything that isn’t exactly 64 valid hex chars. `Buffer.from(hex, 'hex')` silently truncates an odd trailing nibble, stops at the first non-hex char, and over-allocates for overlong input — so a bare `length < 32` check lets malformed/overlong keys alias to the same 32 bytes on the wire. Validating up front keeps distinct invalid inputs distinct (they throw) instead of being truncated. `label` names the caller for the error message. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | -------------- | -------- | | `publicKeyHex` | `string` | | `label` | `string` | ## Returns [Section titled “Returns”](#returns) `Buffer`
# parseRawData
```ts
function parseRawData(frame):
| RawData
| null;
```
Defined in: [src/protocol/repeater.ts:63](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L63) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`RawData`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/rawdata/) | `null`
# parseStatusResponse
```ts
function parseStatusResponse(frame):
| StatusResponse
| null;
```
Defined in: [src/protocol/repeater.ts:448](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L448) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`StatusResponse`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/statusresponse/) | `null`
# parseTelemetryLpp
```ts
function parseTelemetryLpp(lpp): TelemetryField[];
```
Defined in: [src/protocol/repeater.ts:529](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L529) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `lpp` | `Buffer` | ## Returns [Section titled “Returns”](#returns) [`TelemetryField`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/telemetryfield/)\[]
# parseTelemetryResponse
```ts
function parseTelemetryResponse(frame):
| TelemetryResponse
| null;
```
Defined in: [src/protocol/repeater.ts:512](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L512) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`TelemetryResponse`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/telemetryresponse/) | `null`
# parseTraceData
```ts
function parseTraceData(frame):
| TraceData
| null;
```
Defined in: [src/protocol/repeater.ts:114](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L114) ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `frame` | `Buffer` | ## Returns [Section titled “Returns”](#returns) \| [`TraceData`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/tracedata/) | `null`
# verifyAdvert
```ts
function verifyAdvert(advert): boolean;
```
Defined in: [src/protocol/advert.ts:141](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L141) Verify an advert’s ed25519 signature against its own public key. Returns false (never throws) on a malformed key/signature. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ----------------------------------------------------------------------------- | | `advert` | [`Advert`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/advert/) | ## Returns [Section titled “Returns”](#returns) `boolean`
# AclEntry
Defined in: [src/protocol/repeater.ts:139](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L139) ## Properties [Section titled “Properties”](#properties) ### isAdmin [Section titled “isAdmin”](#isadmin)
```ts
isAdmin: boolean;
```
Defined in: [src/protocol/repeater.ts:142](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L142) *** ### isGuest [Section titled “isGuest”](#isguest)
```ts
isGuest: boolean;
```
Defined in: [src/protocol/repeater.ts:143](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L143) *** ### permissions [Section titled “permissions”](#permissions)
```ts
permissions: number;
```
Defined in: [src/protocol/repeater.ts:141](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L141) *** ### pubKeyPrefixHex [Section titled “pubKeyPrefixHex”](#pubkeyprefixhex)
```ts
pubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:140](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L140)
# Advert
Defined in: [src/protocol/advert.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L46) ## Properties [Section titled “Properties”](#properties) ### appData [Section titled “appData”](#appdata)
```ts
appData: AdvertAppData;
```
Defined in: [src/protocol/advert.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L50) *** ### appDataHex [Section titled “appDataHex”](#appdatahex)
```ts
appDataHex: string;
```
Defined in: [src/protocol/advert.ts:51](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L51) *** ### publicKeyHex [Section titled “publicKeyHex”](#publickeyhex)
```ts
publicKeyHex: string;
```
Defined in: [src/protocol/advert.ts:47](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L47) *** ### signatureHex [Section titled “signatureHex”](#signaturehex)
```ts
signatureHex: string;
```
Defined in: [src/protocol/advert.ts:49](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L49) *** ### signedMessage [Section titled “signedMessage”](#signedmessage)
```ts
signedMessage: Buffer;
```
Defined in: [src/protocol/advert.ts:53](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L53) The exact bytes the signature covers: pub\_key || timestamp || app\_data. *** ### timestampUnix [Section titled “timestampUnix”](#timestampunix)
```ts
timestampUnix: number;
```
Defined in: [src/protocol/advert.ts:48](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L48)
# AdvertAppData
Defined in: [src/protocol/advert.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L37) ## Properties [Section titled “Properties”](#properties) ### feat1? [Section titled “feat1?”](#feat1)
```ts
optional feat1?: number;
```
Defined in: [src/protocol/advert.ts:41](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L41) *** ### feat2? [Section titled “feat2?”](#feat2)
```ts
optional feat2?: number;
```
Defined in: [src/protocol/advert.ts:42](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L42) *** ### latlon? [Section titled “latlon?”](#latlon)
```ts
optional latlon?: object;
```
Defined in: [src/protocol/advert.ts:40](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L40) #### lat [Section titled “lat”](#lat)
```ts
lat: number;
```
#### lon [Section titled “lon”](#lon)
```ts
lon: number;
```
*** ### name? [Section titled “name?”](#name)
```ts
optional name?: string;
```
Defined in: [src/protocol/advert.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L43) *** ### type [Section titled “type”](#type)
```ts
type: number;
```
Defined in: [src/protocol/advert.ts:39](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/advert.ts#L39) ADV\_TYPE\_\* (1=chat, 2=repeater, 3=room, 4=sensor).
# AvgMinMaxResult
Defined in: [src/protocol/repeater.ts:713](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L713) ## Properties [Section titled “Properties”](#properties) ### nowUnix [Section titled “nowUnix”](#nowunix)
```ts
nowUnix: number;
```
Defined in: [src/protocol/repeater.ts:715](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L715) Repeater’s RTC time (unix seconds) at the moment it built the response. *** ### series [Section titled “series”](#series)
```ts
series: AvgMinMaxSeries[];
```
Defined in: [src/protocol/repeater.ts:716](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L716)
# AvgMinMaxSeries
Defined in: [src/protocol/repeater.ts:702](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L702) ## Properties [Section titled “Properties”](#properties) ### avg [Section titled “avg”](#avg)
```ts
avg: number;
```
Defined in: [src/protocol/repeater.ts:710](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L710) *** ### channel [Section titled “channel”](#channel)
```ts
channel: number;
```
Defined in: [src/protocol/repeater.ts:703](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L703) *** ### lppType [Section titled “lppType”](#lpptype)
```ts
lppType: number;
```
Defined in: [src/protocol/repeater.ts:704](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L704) *** ### max [Section titled “max”](#max)
```ts
max: number;
```
Defined in: [src/protocol/repeater.ts:709](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L709) *** ### min [Section titled “min”](#min)
```ts
min: number;
```
Defined in: [src/protocol/repeater.ts:708](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L708) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/protocol/repeater.ts:706](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L706) *** ### typeHex [Section titled “typeHex”](#typehex)
```ts
typeHex: string;
```
Defined in: [src/protocol/repeater.ts:705](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L705) *** ### unit? [Section titled “unit?”](#unit)
```ts
optional unit?: string;
```
Defined in: [src/protocol/repeater.ts:707](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L707)
# BinaryResponse
Defined in: [src/protocol/repeater.ts:76](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L76) ## Properties [Section titled “Properties”](#properties) ### payload [Section titled “payload”](#payload)
```ts
payload: Buffer;
```
Defined in: [src/protocol/repeater.ts:79](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L79) *** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/protocol/repeater.ts:78](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L78) *** ### tagHex [Section titled “tagHex”](#taghex)
```ts
tagHex: string;
```
Defined in: [src/protocol/repeater.ts:77](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L77)
# LoginFail
Defined in: [src/protocol/repeater.ts:47](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L47) ## Properties [Section titled “Properties”](#properties) ### pubKeyPrefixHex [Section titled “pubKeyPrefixHex”](#pubkeyprefixhex)
```ts
pubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:48](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L48)
# LoginSuccess
Defined in: [src/protocol/repeater.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L11) ## Properties [Section titled “Properties”](#properties) ### aclPermissions [Section titled “aclPermissions”](#aclpermissions)
```ts
aclPermissions: number | null;
```
Defined in: [src/protocol/repeater.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L15) *** ### firmwareVerLevel [Section titled “firmwareVerLevel”](#firmwareverlevel)
```ts
firmwareVerLevel: number | null;
```
Defined in: [src/protocol/repeater.ts:16](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L16) *** ### isAdmin [Section titled “isAdmin”](#isadmin)
```ts
isAdmin: boolean;
```
Defined in: [src/protocol/repeater.ts:17](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L17) *** ### permissions [Section titled “permissions”](#permissions)
```ts
permissions: number;
```
Defined in: [src/protocol/repeater.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L12) *** ### pubKeyPrefixHex [Section titled “pubKeyPrefixHex”](#pubkeyprefixhex)
```ts
pubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L13) *** ### serverTagHex [Section titled “serverTagHex”](#servertaghex)
```ts
serverTagHex: string | null;
```
Defined in: [src/protocol/repeater.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L14)
# MeshPacketHeader
Defined in: [src/protocol/meshPacket.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L43) ## Properties [Section titled “Properties”](#properties) ### hashCount [Section titled “hashCount”](#hashcount)
```ts
hashCount: number;
```
Defined in: [src/protocol/meshPacket.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L50) Number of hops in the path. May be 0 (originator emitted with empty path). *** ### hashSize [Section titled “hashSize”](#hashsize)
```ts
hashSize: number;
```
Defined in: [src/protocol/meshPacket.ts:48](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L48) Bytes per hop in the path (1, 2, or 3). 4 is reserved by firmware. *** ### pathHex [Section titled “pathHex”](#pathhex)
```ts
pathHex: string;
```
Defined in: [src/protocol/meshPacket.ts:52](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L52) Hex path bytes (hashCount × hashSize). Empty string when hashCount=0. *** ### payload [Section titled “payload”](#payload)
```ts
payload: Buffer;
```
Defined in: [src/protocol/meshPacket.ts:56](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L56) Decrypted-or-not body. For GRP\_TXT, format is: \[channel\_hash 1B]\[MAC 2B]\[encrypted: ts u32 LE + “name: text”] *** ### payloadType [Section titled “payloadType”](#payloadtype)
```ts
payloadType: number;
```
Defined in: [src/protocol/meshPacket.ts:45](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L45) *** ### payloadVer [Section titled “payloadVer”](#payloadver)
```ts
payloadVer: number;
```
Defined in: [src/protocol/meshPacket.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L46) *** ### routeType [Section titled “routeType”](#routetype)
```ts
routeType: number;
```
Defined in: [src/protocol/meshPacket.ts:44](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L44) *** ### transportCodesHex? [Section titled “transportCodesHex?”](#transportcodeshex)
```ts
optional transportCodesHex?: string;
```
Defined in: [src/protocol/meshPacket.ts:53](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L53)
# Neighbour
Defined in: [src/protocol/repeater.ts:166](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L166) ## Properties [Section titled “Properties”](#properties) ### heardSecsAgo [Section titled “heardSecsAgo”](#heardsecsago)
```ts
heardSecsAgo: number;
```
Defined in: [src/protocol/repeater.ts:168](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L168) *** ### pubKeyPrefixHex [Section titled “pubKeyPrefixHex”](#pubkeyprefixhex)
```ts
pubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:167](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L167) *** ### snrDb [Section titled “snrDb”](#snrdb)
```ts
snrDb: number;
```
Defined in: [src/protocol/repeater.ts:169](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L169)
# NeighboursPage
Defined in: [src/protocol/repeater.ts:172](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L172) ## Properties [Section titled “Properties”](#properties) ### neighbours [Section titled “neighbours”](#neighbours)
```ts
neighbours: Neighbour[];
```
Defined in: [src/protocol/repeater.ts:174](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L174) *** ### total [Section titled “total”](#total)
```ts
total: number;
```
Defined in: [src/protocol/repeater.ts:173](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L173)
# OnAirPacket
Defined in: [src/protocol/onAirPackets.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L8) A structurally-decoded MeshCore on-air packet. `header` is null when the input bytes do not parse as a mesh packet (e.g. a 0x84 sentinel frame or a truncated buffer); in that case `payload` is the `raw` fallback variant. ## Properties [Section titled “Properties”](#properties) ### header [Section titled “header”](#header)
```ts
header:
| MeshPacketHeader
| null;
```
Defined in: [src/protocol/onAirPackets.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L9) *** ### payload [Section titled “payload”](#payload)
```ts
payload: OnAirPayload;
```
Defined in: [src/protocol/onAirPackets.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L12) *** ### payloadTypeName [Section titled “payloadTypeName”](#payloadtypename)
```ts
payloadTypeName: string;
```
Defined in: [src/protocol/onAirPackets.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L11) Enum key for `header.payloadType` (e.g. ‘GRP\_TXT’); ‘UNKNOWN’ if absent.
# OwnerInfo
Defined in: [src/protocol/repeater.ts:199](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L199) ## Properties [Section titled “Properties”](#properties) ### firmwareVersion [Section titled “firmwareVersion”](#firmwareversion)
```ts
firmwareVersion: string;
```
Defined in: [src/protocol/repeater.ts:200](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L200) *** ### nodeName [Section titled “nodeName”](#nodename)
```ts
nodeName: string;
```
Defined in: [src/protocol/repeater.ts:201](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L201) *** ### ownerInfo [Section titled “ownerInfo”](#ownerinfo)
```ts
ownerInfo: string;
```
Defined in: [src/protocol/repeater.ts:202](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L202)
# RawData
Defined in: [src/protocol/repeater.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L57) ## Properties [Section titled “Properties”](#properties) ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/protocol/repeater.ts:60](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L60) *** ### rssi [Section titled “rssi”](#rssi)
```ts
rssi: number;
```
Defined in: [src/protocol/repeater.ts:59](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L59) *** ### snrDb [Section titled “snrDb”](#snrdb)
```ts
snrDb: number;
```
Defined in: [src/protocol/repeater.ts:58](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L58)
# StatusField
Defined in: [src/protocol/repeater.ts:442](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L442) ## Properties [Section titled “Properties”](#properties) ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/protocol/repeater.ts:443](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L443) *** ### unit? [Section titled “unit?”](#unit)
```ts
optional unit?: string;
```
Defined in: [src/protocol/repeater.ts:445](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L445) *** ### value [Section titled “value”](#value)
```ts
value: string | number;
```
Defined in: [src/protocol/repeater.ts:444](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L444)
# StatusResponse
Defined in: [src/protocol/repeater.ts:417](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L417) ## Properties [Section titled “Properties”](#properties) ### fields [Section titled “fields”](#fields)
```ts
fields: StatusField[];
```
Defined in: [src/protocol/repeater.ts:420](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L420) *** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/protocol/repeater.ts:419](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L419) *** ### senderPubKeyPrefixHex [Section titled “senderPubKeyPrefixHex”](#senderpubkeyprefixhex)
```ts
senderPubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:418](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L418)
# TelemetryField
Defined in: [src/protocol/repeater.ts:504](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L504) ## Properties [Section titled “Properties”](#properties) ### channel [Section titled “channel”](#channel)
```ts
channel: number;
```
Defined in: [src/protocol/repeater.ts:505](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L505) *** ### name [Section titled “name”](#name)
```ts
name: string;
```
Defined in: [src/protocol/repeater.ts:507](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L507) *** ### typeHex [Section titled “typeHex”](#typehex)
```ts
typeHex: string;
```
Defined in: [src/protocol/repeater.ts:506](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L506) *** ### unit? [Section titled “unit?”](#unit)
```ts
optional unit?: string;
```
Defined in: [src/protocol/repeater.ts:509](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L509) *** ### value [Section titled “value”](#value)
```ts
value: string | number;
```
Defined in: [src/protocol/repeater.ts:508](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L508)
# TelemetryResponse
Defined in: [src/protocol/repeater.ts:498](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L498) ## Properties [Section titled “Properties”](#properties) ### fields [Section titled “fields”](#fields)
```ts
fields: TelemetryField[];
```
Defined in: [src/protocol/repeater.ts:501](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L501) *** ### payloadHex [Section titled “payloadHex”](#payloadhex)
```ts
payloadHex: string;
```
Defined in: [src/protocol/repeater.ts:500](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L500) *** ### senderPubKeyPrefixHex [Section titled “senderPubKeyPrefixHex”](#senderpubkeyprefixhex)
```ts
senderPubKeyPrefixHex: string;
```
Defined in: [src/protocol/repeater.ts:499](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L499)
# TraceData
Defined in: [src/protocol/repeater.ts:105](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L105) ## Properties [Section titled “Properties”](#properties) ### authHex [Section titled “authHex”](#authhex)
```ts
authHex: string;
```
Defined in: [src/protocol/repeater.ts:107](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L107) *** ### finalSnrDb [Section titled “finalSnrDb”](#finalsnrdb)
```ts
finalSnrDb: number;
```
Defined in: [src/protocol/repeater.ts:111](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L111) *** ### flags [Section titled “flags”](#flags)
```ts
flags: number;
```
Defined in: [src/protocol/repeater.ts:108](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L108) *** ### hops [Section titled “hops”](#hops)
```ts
hops: object[];
```
Defined in: [src/protocol/repeater.ts:110](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L110) #### hashHex [Section titled “hashHex”](#hashhex)
```ts
hashHex: string;
```
#### snrDb [Section titled “snrDb”](#snrdb)
```ts
snrDb: number;
```
*** ### pathHashSize [Section titled “pathHashSize”](#pathhashsize)
```ts
pathHashSize: number;
```
Defined in: [src/protocol/repeater.ts:109](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L109) *** ### tagHex [Section titled “tagHex”](#taghex)
```ts
tagHex: string;
```
Defined in: [src/protocol/repeater.ts:106](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L106)
# LocalStats
```ts
type LocalStats =
| {
battMv: number;
errFlags: number;
kind: "core";
queueLen: number;
uptimeSecs: number;
}
| {
kind: "radio";
lastRssi: number;
lastSnrDb: number;
noiseFloor: number;
rxAirSecs: number;
txAirSecs: number;
}
| {
kind: "packets";
nRecvDirect: number;
nRecvErrors: number;
nRecvFlood: number;
nSentDirect: number;
nSentFlood: number;
recv: number;
sent: number;
};
```
Defined in: [src/protocol/repeater.ts:241](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/repeater.ts#L241)
# MeshSource
```ts
type MeshSource = "raw" | "log_rx";
```
Defined in: [src/protocol/frame.ts:70](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/frame.ts#L70) Which push delivered a mesh packet. Only `'log_rx'` (0x88) is safe to feed into the mesh-packet parser — 0x84 (`'raw'`) writes a 0xFF reserved byte where path\_len would be, so its bytes don’t follow the Packet wire format.
# OnAirPayload
```ts
type OnAirPayload =
| {
advert: Advert;
kind: "advert";
}
| {
cipherLen: number;
destHash: string;
kind: "txtMsg";
macHex: string;
srcHash: string;
}
| {
channelHash: string;
cipherLen: number;
kind: "grpTxt";
macHex: string;
}
| {
cipherLen: number;
destHash: string;
kind: "req";
macHex: string;
srcHash: string;
}
| {
cipherLen: number;
destHash: string;
kind: "response";
macHex: string;
srcHash: string;
}
| {
cipherLen: number;
destHash: string;
kind: "anonReq";
macHex: string;
senderPubKeyHex: string;
}
| {
checksumHex: string;
kind: "ack";
}
| {
extraHex: string;
extraType: number;
hashSize: number;
kind: "path";
pathHashesHex: string;
pathLen: number;
}
| {
authCode: number;
flags: number;
hopCount: number;
kind: "trace";
pathHashesHex: string;
snr: number[];
tag: number;
}
| {
kind: "controlDiscoverReq";
prefixOnly: boolean;
since: number;
tag: number;
typeFilter: number;
}
| {
kind: "controlDiscoverResp";
nodeType: number;
publicKeyHex: string;
snr: number;
tag: number;
}
| {
kind: "controlOther";
payloadHex: string;
rawFlags: number;
}
| {
kind: "raw";
payloadHex: string;
payloadType: number | null;
};
```
Defined in: [src/protocol/onAirPackets.ts:17](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L17) Structural (never decrypted) view of an on-air payload, discriminated on `kind`. Cipher bodies are reported only as a length (`cipherLen`).
# ParsedFrame
```ts
type ParsedFrame =
| {
kind: "mesh";
meshBytes: Buffer;
meshHex: string;
rssi: number;
snr: number;
source: MeshSource;
}
| {
code: number;
codeName: string;
kind: "companion";
payloadBytes: Buffer;
payloadHex: string;
};
```
Defined in: [src/protocol/frame.ts:72](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/frame.ts#L72) ## Union Members [Section titled “Union Members”](#union-members) ### Type Literal [Section titled “Type Literal”](#type-literal)
```ts
{
kind: "mesh";
meshBytes: Buffer;
meshHex: string;
rssi: number;
snr: number;
source: MeshSource;
}
```
#### kind [Section titled “kind”](#kind)
```ts
kind: "mesh";
```
#### meshBytes [Section titled “meshBytes”](#meshbytes)
```ts
meshBytes: Buffer;
```
#### meshHex [Section titled “meshHex”](#meshhex)
```ts
meshHex: string;
```
#### rssi [Section titled “rssi”](#rssi)
```ts
rssi: number;
```
#### snr [Section titled “snr”](#snr)
```ts
snr: number;
```
#### source [Section titled “source”](#source)
```ts
source: MeshSource;
```
See [MeshSource](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/meshsource/). *** ### Type Literal [Section titled “Type Literal”](#type-literal-1)
```ts
{
code: number;
codeName: string;
kind: "companion";
payloadBytes: Buffer;
payloadHex: string;
}
```
# PayloadKind
```ts
type PayloadKind = OnAirPayload["kind"];
```
Defined in: [src/protocol/onAirPackets.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L37) Union of the `kind` discriminant values (`'advert' | 'grpTxt' | …`); interchangeable with `PayloadKind` values.
# ADV_TYPE
```ts
const ADV_TYPE: object;
```
Defined in: [src/protocol/codes.ts:300](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L300) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### CHAT [Section titled “CHAT”](#chat)
```ts
readonly CHAT: 1 = 1;
```
### REPEATER [Section titled “REPEATER”](#repeater)
```ts
readonly REPEATER: 2 = 2;
```
### ROOM [Section titled “ROOM”](#room)
```ts
readonly ROOM: 3 = 3;
```
### SENSOR [Section titled “SENSOR”](#sensor)
```ts
readonly SENSOR: 4 = 4;
```
# ANON_REQ_TYPE
```ts
const ANON_REQ_TYPE: object;
```
Defined in: [src/protocol/codes.ts:360](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L360) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### BASIC [Section titled “BASIC”](#basic)
```ts
readonly BASIC: 3 = 0x03;
```
### OWNER [Section titled “OWNER”](#owner)
```ts
readonly OWNER: 2 = 0x02;
```
### REGIONS [Section titled “REGIONS”](#regions)
```ts
readonly REGIONS: 1 = 0x01;
```
# APP_PROTOCOL_VERSION
```ts
const APP_PROTOCOL_VERSION: 4 = 4;
```
Defined in: [src/protocol/codes.ts:210](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L210)
# CMD
```ts
const CMD: object;
```
Defined in: [src/protocol/codes.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L12) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ADD\_UPDATE\_CONTACT [Section titled “ADD\_UPDATE\_CONTACT”](#add_update_contact)
```ts
readonly ADD_UPDATE_CONTACT: 9 = 0x09;
```
### APP\_START [Section titled “APP\_START”](#app_start)
```ts
readonly APP_START: 1 = 0x01;
```
### DEVICE\_QUERY [Section titled “DEVICE\_QUERY”](#device_query)
```ts
readonly DEVICE_QUERY: 22 = 0x16;
```
### EXPORT\_CONTACT [Section titled “EXPORT\_CONTACT”](#export_contact)
```ts
readonly EXPORT_CONTACT: 17 = 0x11;
```
### EXPORT\_PRIVATE\_KEY [Section titled “EXPORT\_PRIVATE\_KEY”](#export_private_key)
```ts
readonly EXPORT_PRIVATE_KEY: 23 = 0x17;
```
### FACTORY\_RESET [Section titled “FACTORY\_RESET”](#factory_reset)
```ts
readonly FACTORY_RESET: 51 = 0x33;
```
### GET\_ADVERT\_PATH [Section titled “GET\_ADVERT\_PATH”](#get_advert_path)
```ts
readonly GET_ADVERT_PATH: 42 = 0x2a;
```
### GET\_ALLOWED\_REPEAT\_FREQ [Section titled “GET\_ALLOWED\_REPEAT\_FREQ”](#get_allowed_repeat_freq)
```ts
readonly GET_ALLOWED_REPEAT_FREQ: 60 = 0x3c;
```
### GET\_AUTO\_ADD\_CONFIG [Section titled “GET\_AUTO\_ADD\_CONFIG”](#get_auto_add_config)
```ts
readonly GET_AUTO_ADD_CONFIG: 59 = 0x3b;
```
### GET\_BATT\_AND\_STORAGE [Section titled “GET\_BATT\_AND\_STORAGE”](#get_batt_and_storage)
```ts
readonly GET_BATT_AND_STORAGE: 20 = 0x14;
```
### GET\_CHANNEL [Section titled “GET\_CHANNEL”](#get_channel)
```ts
readonly GET_CHANNEL: 31 = 0x1f;
```
### GET\_CONTACT\_BY\_KEY [Section titled “GET\_CONTACT\_BY\_KEY”](#get_contact_by_key)
```ts
readonly GET_CONTACT_BY_KEY: 30 = 0x1e;
```
### GET\_CONTACTS [Section titled “GET\_CONTACTS”](#get_contacts)
```ts
readonly GET_CONTACTS: 4 = 0x04;
```
### GET\_CUSTOM\_VAR [Section titled “GET\_CUSTOM\_VAR”](#get_custom_var)
```ts
readonly GET_CUSTOM_VAR: 40 = 0x28;
```
### GET\_DEFAULT\_FLOOD\_SCOPE [Section titled “GET\_DEFAULT\_FLOOD\_SCOPE”](#get_default_flood_scope)
```ts
readonly GET_DEFAULT_FLOOD_SCOPE: 64 = 0x40;
```
### GET\_DEVICE\_TIME [Section titled “GET\_DEVICE\_TIME”](#get_device_time)
```ts
readonly GET_DEVICE_TIME: 5 = 0x05;
```
### GET\_NEXT\_MSG [Section titled “GET\_NEXT\_MSG”](#get_next_msg)
```ts
readonly GET_NEXT_MSG: 10 = 0x0a;
```
### GET\_STATS [Section titled “GET\_STATS”](#get_stats)
```ts
readonly GET_STATS: 56 = 0x38;
```
### GET\_TUNING\_PARAMS [Section titled “GET\_TUNING\_PARAMS”](#get_tuning_params)
```ts
readonly GET_TUNING_PARAMS: 43 = 0x2b;
```
### HAS\_CONNECTION [Section titled “HAS\_CONNECTION”](#has_connection)
```ts
readonly HAS_CONNECTION: 28 = 0x1c;
```
### IMPORT\_CONTACT [Section titled “IMPORT\_CONTACT”](#import_contact)
```ts
readonly IMPORT_CONTACT: 18 = 0x12;
```
### IMPORT\_PRIVATE\_KEY [Section titled “IMPORT\_PRIVATE\_KEY”](#import_private_key)
```ts
readonly IMPORT_PRIVATE_KEY: 24 = 0x18;
```
### LOGOUT [Section titled “LOGOUT”](#logout)
```ts
readonly LOGOUT: 29 = 0x1d;
```
### REBOOT [Section titled “REBOOT”](#reboot)
```ts
readonly REBOOT: 19 = 0x13;
```
### REMOVE\_CONTACT [Section titled “REMOVE\_CONTACT”](#remove_contact)
```ts
readonly REMOVE_CONTACT: 15 = 0x0f;
```
### RESET\_PATH [Section titled “RESET\_PATH”](#reset_path)
```ts
readonly RESET_PATH: 13 = 0x0d;
```
### SEND\_ANON\_REQ [Section titled “SEND\_ANON\_REQ”](#send_anon_req)
```ts
readonly SEND_ANON_REQ: 57 = 0x39;
```
### SEND\_BINARY\_REQ [Section titled “SEND\_BINARY\_REQ”](#send_binary_req)
```ts
readonly SEND_BINARY_REQ: 50 = 0x32;
```
### SEND\_CHAN\_TXT\_MSG [Section titled “SEND\_CHAN\_TXT\_MSG”](#send_chan_txt_msg)
```ts
readonly SEND_CHAN_TXT_MSG: 3 = 0x03;
```
### SEND\_CHANNEL\_DATA [Section titled “SEND\_CHANNEL\_DATA”](#send_channel_data)
```ts
readonly SEND_CHANNEL_DATA: 62 = 0x3e;
```
### SEND\_CONTROL\_DATA [Section titled “SEND\_CONTROL\_DATA”](#send_control_data)
```ts
readonly SEND_CONTROL_DATA: 55 = 0x37;
```
### SEND\_LOGIN [Section titled “SEND\_LOGIN”](#send_login)
```ts
readonly SEND_LOGIN: 26 = 0x1a;
```
### SEND\_PATH\_DISCOVERY\_REQ [Section titled “SEND\_PATH\_DISCOVERY\_REQ”](#send_path_discovery_req)
```ts
readonly SEND_PATH_DISCOVERY_REQ: 52 = 0x34;
```
### SEND\_RAW\_DATA [Section titled “SEND\_RAW\_DATA”](#send_raw_data)
```ts
readonly SEND_RAW_DATA: 25 = 0x19;
```
### SEND\_RAW\_PACKET [Section titled “SEND\_RAW\_PACKET”](#send_raw_packet)
```ts
readonly SEND_RAW_PACKET: 65 = 0x41;
```
### SEND\_SELF\_ADVERT [Section titled “SEND\_SELF\_ADVERT”](#send_self_advert)
```ts
readonly SEND_SELF_ADVERT: 7 = 0x07;
```
### SEND\_STATUS\_REQ [Section titled “SEND\_STATUS\_REQ”](#send_status_req)
```ts
readonly SEND_STATUS_REQ: 27 = 0x1b;
```
### SEND\_TELEMETRY\_REQ [Section titled “SEND\_TELEMETRY\_REQ”](#send_telemetry_req)
```ts
readonly SEND_TELEMETRY_REQ: 39 = 0x27;
```
### SEND\_TRACE\_PATH [Section titled “SEND\_TRACE\_PATH”](#send_trace_path)
```ts
readonly SEND_TRACE_PATH: 36 = 0x24;
```
### SEND\_TXT\_MSG [Section titled “SEND\_TXT\_MSG”](#send_txt_msg)
```ts
readonly SEND_TXT_MSG: 2 = 0x02;
```
### SET\_ADVERT\_LATLON [Section titled “SET\_ADVERT\_LATLON”](#set_advert_latlon)
```ts
readonly SET_ADVERT_LATLON: 14 = 0x0e;
```
### SET\_ADVERT\_NAME [Section titled “SET\_ADVERT\_NAME”](#set_advert_name)
```ts
readonly SET_ADVERT_NAME: 8 = 0x08;
```
### SET\_AUTO\_ADD\_CONFIG [Section titled “SET\_AUTO\_ADD\_CONFIG”](#set_auto_add_config)
```ts
readonly SET_AUTO_ADD_CONFIG: 58 = 0x3a;
```
### SET\_CHANNEL [Section titled “SET\_CHANNEL”](#set_channel)
```ts
readonly SET_CHANNEL: 32 = 0x20;
```
### SET\_CUSTOM\_VAR [Section titled “SET\_CUSTOM\_VAR”](#set_custom_var)
```ts
readonly SET_CUSTOM_VAR: 41 = 0x29;
```
### SET\_DEFAULT\_FLOOD\_SCOPE [Section titled “SET\_DEFAULT\_FLOOD\_SCOPE”](#set_default_flood_scope)
```ts
readonly SET_DEFAULT_FLOOD_SCOPE: 63 = 0x3f;
```
### SET\_DEVICE\_PIN [Section titled “SET\_DEVICE\_PIN”](#set_device_pin)
```ts
readonly SET_DEVICE_PIN: 37 = 0x25;
```
### SET\_DEVICE\_TIME [Section titled “SET\_DEVICE\_TIME”](#set_device_time)
```ts
readonly SET_DEVICE_TIME: 6 = 0x06;
```
### SET\_FLOOD\_SCOPE\_KEY [Section titled “SET\_FLOOD\_SCOPE\_KEY”](#set_flood_scope_key)
```ts
readonly SET_FLOOD_SCOPE_KEY: 54 = 0x36;
```
### SET\_OTHER\_PARAMS [Section titled “SET\_OTHER\_PARAMS”](#set_other_params)
```ts
readonly SET_OTHER_PARAMS: 38 = 0x26;
```
### SET\_PATH\_HASH\_MODE [Section titled “SET\_PATH\_HASH\_MODE”](#set_path_hash_mode)
```ts
readonly SET_PATH_HASH_MODE: 61 = 0x3d;
```
### SET\_RADIO\_PARAMS [Section titled “SET\_RADIO\_PARAMS”](#set_radio_params)
```ts
readonly SET_RADIO_PARAMS: 11 = 0x0b;
```
### SET\_RADIO\_TX\_POWER [Section titled “SET\_RADIO\_TX\_POWER”](#set_radio_tx_power)
```ts
readonly SET_RADIO_TX_POWER: 12 = 0x0c;
```
### SET\_TUNING\_PARAMS [Section titled “SET\_TUNING\_PARAMS”](#set_tuning_params)
```ts
readonly SET_TUNING_PARAMS: 21 = 0x15;
```
### SHARE\_CONTACT [Section titled “SHARE\_CONTACT”](#share_contact)
```ts
readonly SHARE_CONTACT: 16 = 0x10;
```
### SIGN\_DATA [Section titled “SIGN\_DATA”](#sign_data)
```ts
readonly SIGN_DATA: 34 = 0x22;
```
### SIGN\_FINISH [Section titled “SIGN\_FINISH”](#sign_finish)
```ts
readonly SIGN_FINISH: 35 = 0x23;
```
### SIGN\_START [Section titled “SIGN\_START”](#sign_start)
```ts
readonly SIGN_START: 33 = 0x21;
```
# ERR_CODE
```ts
const ERR_CODE: object;
```
Defined in: [src/protocol/codes.ts:289](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L289) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### BAD\_STATE [Section titled “BAD\_STATE”](#bad_state)
```ts
readonly BAD_STATE: 4 = 0x04;
```
### FILE\_IO\_ERROR [Section titled “FILE\_IO\_ERROR”](#file_io_error)
```ts
readonly FILE_IO_ERROR: 5 = 0x05;
```
### ILLEGAL\_ARG [Section titled “ILLEGAL\_ARG”](#illegal_arg)
```ts
readonly ILLEGAL_ARG: 6 = 0x06;
```
### NOT\_FOUND [Section titled “NOT\_FOUND”](#not_found)
```ts
readonly NOT_FOUND: 2 = 0x02;
```
### TABLE\_FULL [Section titled “TABLE\_FULL”](#table_full)
```ts
readonly TABLE_FULL: 3 = 0x03;
```
### UNSUPPORTED\_CMD [Section titled “UNSUPPORTED\_CMD”](#unsupported_cmd)
```ts
readonly UNSUPPORTED_CMD: 1 = 0x01;
```
# PAYLOAD_TYPE
```ts
const PAYLOAD_TYPE: object;
```
Defined in: [src/protocol/meshPacket.ts:27](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L27) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ACK [Section titled “ACK”](#ack)
```ts
readonly ACK: 3 = 0x03;
```
### ADVERT [Section titled “ADVERT”](#advert)
```ts
readonly ADVERT: 4 = 0x04;
```
### ANON\_REQ [Section titled “ANON\_REQ”](#anon_req)
```ts
readonly ANON_REQ: 7 = 0x07;
```
### CONTROL [Section titled “CONTROL”](#control)
```ts
readonly CONTROL: 11 = 0x0b;
```
### GRP\_DATA [Section titled “GRP\_DATA”](#grp_data)
```ts
readonly GRP_DATA: 6 = 0x06;
```
### GRP\_TXT [Section titled “GRP\_TXT”](#grp_txt)
```ts
readonly GRP_TXT: 5 = 0x05;
```
### MULTIPART [Section titled “MULTIPART”](#multipart)
```ts
readonly MULTIPART: 10 = 0x0a;
```
### PATH [Section titled “PATH”](#path)
```ts
readonly PATH: 8 = 0x08;
```
### RAW\_CUSTOM [Section titled “RAW\_CUSTOM”](#raw_custom)
```ts
readonly RAW_CUSTOM: 15 = 0x0f;
```
### REQ [Section titled “REQ”](#req)
```ts
readonly REQ: 0 = 0x00;
```
### RESPONSE [Section titled “RESPONSE”](#response)
```ts
readonly RESPONSE: 1 = 0x01;
```
### TRACE [Section titled “TRACE”](#trace)
```ts
readonly TRACE: 9 = 0x09;
```
### TXT\_MSG [Section titled “TXT\_MSG”](#txt_msg)
```ts
readonly TXT_MSG: 2 = 0x02;
```
# PayloadKind
```ts
const PayloadKind: object;
```
Defined in: [src/protocol/onAirPackets.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/onAirPackets.ts#L37) Named constants for the [OnAirPayload](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/onairpayload/) `kind` discriminant, so consumers branch on readable names instead of bare strings: `case PayloadKind.GRP_TXT` (=== ‘grpTxt’). Values equal the `kind` literals, so the constant and the raw string are interchangeable and both narrow `payload`. Distinct from the numeric wire enum [PAYLOAD\_TYPE](/meshcore-ts/api/andyshinn/namespaces/protocol/variables/payload_type/) (keys `header.payloadType`). ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ACK [Section titled “ACK”](#ack)
```ts
readonly ACK: "ack" = 'ack';
```
### ADVERT [Section titled “ADVERT”](#advert)
```ts
readonly ADVERT: "advert" = 'advert';
```
### ANON\_REQ [Section titled “ANON\_REQ”](#anon_req)
```ts
readonly ANON_REQ: "anonReq" = 'anonReq';
```
### CONTROL\_DISCOVER\_REQ [Section titled “CONTROL\_DISCOVER\_REQ”](#control_discover_req)
```ts
readonly CONTROL_DISCOVER_REQ: "controlDiscoverReq" = 'controlDiscoverReq';
```
### CONTROL\_DISCOVER\_RESP [Section titled “CONTROL\_DISCOVER\_RESP”](#control_discover_resp)
```ts
readonly CONTROL_DISCOVER_RESP: "controlDiscoverResp" = 'controlDiscoverResp';
```
### CONTROL\_OTHER [Section titled “CONTROL\_OTHER”](#control_other)
```ts
readonly CONTROL_OTHER: "controlOther" = 'controlOther';
```
### GRP\_TXT [Section titled “GRP\_TXT”](#grp_txt)
```ts
readonly GRP_TXT: "grpTxt" = 'grpTxt';
```
### PATH [Section titled “PATH”](#path)
```ts
readonly PATH: "path" = 'path';
```
### RAW [Section titled “RAW”](#raw)
```ts
readonly RAW: "raw" = 'raw';
```
### REQ [Section titled “REQ”](#req)
```ts
readonly REQ: "req" = 'req';
```
### RESPONSE [Section titled “RESPONSE”](#response)
```ts
readonly RESPONSE: "response" = 'response';
```
### TRACE [Section titled “TRACE”](#trace)
```ts
readonly TRACE: "trace" = 'trace';
```
### TXT\_MSG [Section titled “TXT\_MSG”](#txt_msg)
```ts
readonly TXT_MSG: "txtMsg" = 'txtMsg';
```
# PERM_BITS
```ts
const PERM_BITS: object;
```
Defined in: [src/protocol/codes.ts:400](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L400) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ACL\_ADMIN [Section titled “ACL\_ADMIN”](#acl_admin)
```ts
readonly ACL_ADMIN: 3 = 0x03;
```
### ACL\_GUEST [Section titled “ACL\_GUEST”](#acl_guest)
```ts
readonly ACL_GUEST: 0 = 0x00;
```
### ACL\_READ\_ONLY [Section titled “ACL\_READ\_ONLY”](#acl_read_only)
```ts
readonly ACL_READ_ONLY: 1 = 0x01;
```
### ACL\_READ\_WRITE [Section titled “ACL\_READ\_WRITE”](#acl_read_write)
```ts
readonly ACL_READ_WRITE: 2 = 0x02;
```
### ACL\_ROLE\_MASK [Section titled “ACL\_ROLE\_MASK”](#acl_role_mask)
```ts
readonly ACL_ROLE_MASK: 3 = 0x03;
```
# PUSH
```ts
const PUSH: object;
```
Defined in: [src/protocol/codes.ts:307](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L307) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ADVERT [Section titled “ADVERT”](#advert)
```ts
readonly ADVERT: 128 = 0x80;
```
### BINARY\_RESPONSE [Section titled “BINARY\_RESPONSE”](#binary_response)
```ts
readonly BINARY_RESPONSE: 140 = 0x8c;
```
### CONTACT\_DELETED [Section titled “CONTACT\_DELETED”](#contact_deleted)
```ts
readonly CONTACT_DELETED: 143 = 0x8f;
```
### CONTACTS\_FULL [Section titled “CONTACTS\_FULL”](#contacts_full)
```ts
readonly CONTACTS_FULL: 144 = 0x90;
```
### CONTROL\_DATA [Section titled “CONTROL\_DATA”](#control_data)
```ts
readonly CONTROL_DATA: 142 = 0x8e;
```
### LOGIN\_FAIL [Section titled “LOGIN\_FAIL”](#login_fail)
```ts
readonly LOGIN_FAIL: 134 = 0x86;
```
### LOGIN\_SUCCESS [Section titled “LOGIN\_SUCCESS”](#login_success)
```ts
readonly LOGIN_SUCCESS: 133 = 0x85;
```
### MSG\_WAITING [Section titled “MSG\_WAITING”](#msg_waiting)
```ts
readonly MSG_WAITING: 131 = 0x83;
```
### NEW\_ADVERT [Section titled “NEW\_ADVERT”](#new_advert)
```ts
readonly NEW_ADVERT: 138 = 0x8a;
```
### PATH\_DISCOVERY\_RESPONSE [Section titled “PATH\_DISCOVERY\_RESPONSE”](#path_discovery_response)
```ts
readonly PATH_DISCOVERY_RESPONSE: 141 = 0x8d;
```
### PATH\_UPDATED [Section titled “PATH\_UPDATED”](#path_updated)
```ts
readonly PATH_UPDATED: 129 = 0x81;
```
### RAW\_DATA [Section titled “RAW\_DATA”](#raw_data)
```ts
readonly RAW_DATA: 132 = 0x84;
```
### SEND\_CONFIRMED [Section titled “SEND\_CONFIRMED”](#send_confirmed)
```ts
readonly SEND_CONFIRMED: 130 = 0x82;
```
### STATUS\_RESPONSE [Section titled “STATUS\_RESPONSE”](#status_response)
```ts
readonly STATUS_RESPONSE: 135 = 0x87;
```
### TELEMETRY\_RESPONSE [Section titled “TELEMETRY\_RESPONSE”](#telemetry_response)
```ts
readonly TELEMETRY_RESPONSE: 139 = 0x8b;
```
### TRACE\_DATA [Section titled “TRACE\_DATA”](#trace_data)
```ts
readonly TRACE_DATA: 137 = 0x89;
```
# REQ_TYPE
```ts
const REQ_TYPE: object;
```
Defined in: [src/protocol/codes.ts:348](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L348) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### GET\_ACCESS\_LIST [Section titled “GET\_ACCESS\_LIST”](#get_access_list)
```ts
readonly GET_ACCESS_LIST: 5 = 0x05;
```
### GET\_AVG\_MIN\_MAX [Section titled “GET\_AVG\_MIN\_MAX”](#get_avg_min_max)
```ts
readonly GET_AVG_MIN_MAX: 4 = 0x04;
```
### GET\_NEIGHBOURS [Section titled “GET\_NEIGHBOURS”](#get_neighbours)
```ts
readonly GET_NEIGHBOURS: 6 = 0x06;
```
### GET\_OWNER\_INFO [Section titled “GET\_OWNER\_INFO”](#get_owner_info)
```ts
readonly GET_OWNER_INFO: 7 = 0x07;
```
### GET\_STATUS [Section titled “GET\_STATUS”](#get_status)
```ts
readonly GET_STATUS: 1 = 0x01;
```
### GET\_TELEMETRY\_DATA [Section titled “GET\_TELEMETRY\_DATA”](#get_telemetry_data)
```ts
readonly GET_TELEMETRY_DATA: 3 = 0x03;
```
### KEEP\_ALIVE [Section titled “KEEP\_ALIVE”](#keep_alive)
```ts
readonly KEEP_ALIVE: 2 = 0x02;
```
# RESP
```ts
const RESP: object;
```
Defined in: [src/protocol/codes.ts:220](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L220) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### ADVERT\_PATH [Section titled “ADVERT\_PATH”](#advert_path)
```ts
readonly ADVERT_PATH: 22 = 0x16;
```
### ALLOWED\_REPEAT\_FREQ [Section titled “ALLOWED\_REPEAT\_FREQ”](#allowed_repeat_freq)
```ts
readonly ALLOWED_REPEAT_FREQ: 26 = 0x1a;
```
### AUTOADD\_CONFIG [Section titled “AUTOADD\_CONFIG”](#autoadd_config)
```ts
readonly AUTOADD_CONFIG: 25 = 0x19;
```
### BATT\_AND\_STORAGE [Section titled “BATT\_AND\_STORAGE”](#batt_and_storage)
```ts
readonly BATT_AND_STORAGE: 12 = 0x0c;
```
### CHANNEL\_DATA\_RECV [Section titled “CHANNEL\_DATA\_RECV”](#channel_data_recv)
```ts
readonly CHANNEL_DATA_RECV: 27 = 0x1b;
```
### CHANNEL\_INFO [Section titled “CHANNEL\_INFO”](#channel_info)
```ts
readonly CHANNEL_INFO: 18 = 0x12;
```
### CHANNEL\_MSG\_RECV [Section titled “CHANNEL\_MSG\_RECV”](#channel_msg_recv)
```ts
readonly CHANNEL_MSG_RECV: 8 = 0x08;
```
### CHANNEL\_MSG\_RECV\_V3 [Section titled “CHANNEL\_MSG\_RECV\_V3”](#channel_msg_recv_v3)
```ts
readonly CHANNEL_MSG_RECV_V3: 17 = 0x11;
```
### CONTACT [Section titled “CONTACT”](#contact)
```ts
readonly CONTACT: 3 = 0x03;
```
### CONTACT\_MSG\_RECV [Section titled “CONTACT\_MSG\_RECV”](#contact_msg_recv)
```ts
readonly CONTACT_MSG_RECV: 7 = 0x07;
```
### CONTACT\_MSG\_RECV\_V3 [Section titled “CONTACT\_MSG\_RECV\_V3”](#contact_msg_recv_v3)
```ts
readonly CONTACT_MSG_RECV_V3: 16 = 0x10;
```
### CONTACTS\_START [Section titled “CONTACTS\_START”](#contacts_start)
```ts
readonly CONTACTS_START: 2 = 0x02;
```
### CURR\_TIME [Section titled “CURR\_TIME”](#curr_time)
```ts
readonly CURR_TIME: 9 = 0x09;
```
### CUSTOM\_VARS [Section titled “CUSTOM\_VARS”](#custom_vars)
```ts
readonly CUSTOM_VARS: 21 = 0x15;
```
### DEFAULT\_FLOOD\_SCOPE [Section titled “DEFAULT\_FLOOD\_SCOPE”](#default_flood_scope)
```ts
readonly DEFAULT_FLOOD_SCOPE: 28 = 0x1c;
```
### DEVICE\_INFO [Section titled “DEVICE\_INFO”](#device_info)
```ts
readonly DEVICE_INFO: 13 = 0x0d;
```
### DISABLED [Section titled “DISABLED”](#disabled)
```ts
readonly DISABLED: 15 = 0x0f;
```
### END\_OF\_CONTACTS [Section titled “END\_OF\_CONTACTS”](#end_of_contacts)
```ts
readonly END_OF_CONTACTS: 4 = 0x04;
```
### ERR [Section titled “ERR”](#err)
```ts
readonly ERR: 1 = 0x01;
```
### EXPORT\_CONTACT [Section titled “EXPORT\_CONTACT”](#export_contact)
```ts
readonly EXPORT_CONTACT: 11 = 0x0b;
```
### NO\_MORE\_MESSAGES [Section titled “NO\_MORE\_MESSAGES”](#no_more_messages)
```ts
readonly NO_MORE_MESSAGES: 10 = 0x0a;
```
### OK [Section titled “OK”](#ok)
```ts
readonly OK: 0 = 0x00;
```
### PRIVATE\_KEY [Section titled “PRIVATE\_KEY”](#private_key)
```ts
readonly PRIVATE_KEY: 14 = 0x0e;
```
### SELF\_INFO [Section titled “SELF\_INFO”](#self_info)
```ts
readonly SELF_INFO: 5 = 0x05;
```
### SENT [Section titled “SENT”](#sent)
```ts
readonly SENT: 6 = 0x06;
```
### SIGN\_START [Section titled “SIGN\_START”](#sign_start)
```ts
readonly SIGN_START: 19 = 0x13;
```
### SIGNATURE [Section titled “SIGNATURE”](#signature)
```ts
readonly SIGNATURE: 20 = 0x14;
```
### STATS [Section titled “STATS”](#stats)
```ts
readonly STATS: 24 = 0x18;
```
### TUNING\_PARAMS [Section titled “TUNING\_PARAMS”](#tuning_params)
```ts
readonly TUNING_PARAMS: 23 = 0x17;
```
# ROUTE_TYPE
```ts
const ROUTE_TYPE: object;
```
Defined in: [src/protocol/meshPacket.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/meshPacket.ts#L20) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### DIRECT [Section titled “DIRECT”](#direct)
```ts
readonly DIRECT: 2 = 0x02;
```
### FLOOD [Section titled “FLOOD”](#flood)
```ts
readonly FLOOD: 1 = 0x01;
```
### TRANSPORT\_DIRECT [Section titled “TRANSPORT\_DIRECT”](#transport_direct)
```ts
readonly TRANSPORT_DIRECT: 3 = 0x03;
```
### TRANSPORT\_FLOOD [Section titled “TRANSPORT\_FLOOD”](#transport_flood)
```ts
readonly TRANSPORT_FLOOD: 0 = 0x00;
```
# STATS_TYPE
```ts
const STATS_TYPE: object;
```
Defined in: [src/protocol/codes.ts:391](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L391) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### CORE [Section titled “CORE”](#core)
```ts
readonly CORE: 0 = 0x00;
```
### PACKETS [Section titled “PACKETS”](#packets)
```ts
readonly PACKETS: 2 = 0x02;
```
### RADIO [Section titled “RADIO”](#radio)
```ts
readonly RADIO: 1 = 0x01;
```
# TXT_TYPE
```ts
const TXT_TYPE: object;
```
Defined in: [src/protocol/codes.ts:214](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/protocol/codes.ts#L214) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### CLI\_DATA [Section titled “CLI\_DATA”](#cli_data)
```ts
readonly CLI_DATA: 1 = 1;
```
### PLAIN [Section titled “PLAIN”](#plain)
```ts
readonly PLAIN: 0 = 0;
```
### SIGNED\_PLAIN [Section titled “SIGNED\_PLAIN”](#signed_plain)
```ts
readonly SIGNED_PLAIN: 2 = 2;
```
# Ble
Defined in: [src/transports/bleTransport.ts:70](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L70) Inheritance-friendly wrapper over createBleTransport. Subclass implements writeChunk() and calls the protected deliver()/setState() from its own BLE event wiring. Bytes-only — do any base64 (e.g. react-native-ble-plx) encoding inside the subclass. ## Implements [Section titled “Implements”](#implements) * [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/) ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new Ble(): BleTransport;
```
Defined in: [src/transports/bleTransport.ts:76](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L76) #### Returns [Section titled “Returns”](#returns) `BleTransport` ## Methods [Section titled “Methods”](#methods) ### getState() [Section titled “getState()”](#getstate)
```ts
getState(): TransportState;
```
Defined in: [src/transports/bleTransport.ts:110](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L110) #### Returns [Section titled “Returns”](#returns-1) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) #### Implementation of [Section titled “Implementation of”](#implementation-of) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`getState`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#getstate) *** ### onData() [Section titled “onData()”](#ondata)
```ts
onData(cb): void;
```
Defined in: [src/transports/bleTransport.ts:104](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L104) Each chunk is ONE complete companion frame (a BLE notification payload). #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------- | | `cb` | (`chunk`) => `void` | #### Returns [Section titled “Returns”](#returns-2) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-1) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onData`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#ondata) *** ### onStateChange() [Section titled “onStateChange()”](#onstatechange)
```ts
onStateChange(cb): void;
```
Defined in: [src/transports/bleTransport.ts:107](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L107) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------- | | `cb` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-3) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-2) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onStateChange`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#onstatechange) *** ### send() [Section titled “send()”](#send)
```ts
send(bytes): Promise;
```
Defined in: [src/transports/bleTransport.ts:101](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L101) Write one complete companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-4) `Promise`<`void`> #### Implementation of [Section titled “Implementation of”](#implementation-of-3) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`send`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#send)
# Loopback
Defined in: [src/ports/transport.ts:18](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L18) In-memory Transport for tests and examples. Captures everything sent and lets a driver push inbound frames / state transitions into the session under test. ## Implements [Section titled “Implements”](#implements) * [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/) ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new Loopback(): LoopbackTransport;
```
#### Returns [Section titled “Returns”](#returns) `LoopbackTransport` ## Properties [Section titled “Properties”](#properties) ### sent [Section titled “sent”](#sent)
```ts
readonly sent: Uint8Array[] = [];
```
Defined in: [src/ports/transport.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L20) Outbound frames captured for assertions (in send order). ## Methods [Section titled “Methods”](#methods) ### getState() [Section titled “getState()”](#getstate)
```ts
getState(): TransportState;
```
Defined in: [src/ports/transport.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L37) #### Returns [Section titled “Returns”](#returns-1) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) #### Implementation of [Section titled “Implementation of”](#implementation-of) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`getState`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#getstate) *** ### lastSentHex() [Section titled “lastSentHex()”](#lastsenthex)
```ts
lastSentHex(): string | undefined;
```
Defined in: [src/ports/transport.ts:60](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L60) Last sent frame as hex (or undefined). #### Returns [Section titled “Returns”](#returns-2) `string` | `undefined` *** ### onData() [Section titled “onData()”](#ondata)
```ts
onData(cb): void;
```
Defined in: [src/ports/transport.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L29) Each chunk is ONE complete companion frame (a BLE notification payload). #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------- | | `cb` | (`chunk`) => `void` | #### Returns [Section titled “Returns”](#returns-3) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-1) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onData`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#ondata) *** ### onStateChange() [Section titled “onStateChange()”](#onstatechange)
```ts
onStateChange(cb): void;
```
Defined in: [src/ports/transport.ts:33](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L33) #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------- | | `cb` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-4) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-2) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onStateChange`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#onstatechange) *** ### receive() [Section titled “receive()”](#receive)
```ts
receive(frame): void;
```
Defined in: [src/ports/transport.ts:50](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L50) Deliver one inbound companion frame to the session. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ------------ | | `frame` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-5) `void` *** ### receiveHex() [Section titled “receiveHex()”](#receivehex)
```ts
receiveHex(hex): void;
```
Defined in: [src/ports/transport.ts:55](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L55) Convenience: deliver an inbound frame from a hex string. #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | -------- | | `hex` | `string` | #### Returns [Section titled “Returns”](#returns-6) `void` *** ### send() [Section titled “send()”](#send)
```ts
send(bytes): Promise;
```
Defined in: [src/ports/transport.ts:25](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L25) Write one complete companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-4) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-7) `Promise`<`void`> #### Implementation of [Section titled “Implementation of”](#implementation-of-3) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`send`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#send) *** ### setState() [Section titled “setState()”](#setstate)
```ts
setState(s): void;
```
Defined in: [src/ports/transport.ts:44](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/ports/transport.ts#L44) Transition state and notify the subscriber. #### Parameters [Section titled “Parameters”](#parameters-5) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------- | | `s` | [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) | #### Returns [Section titled “Returns”](#returns-8) `void`
# Serial
Defined in: [src/transports/serialTransport.ts:21](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L21) Transport that frames the MeshCore serial protocol over a duck-typed port. The user owns opening/closing the port; this only observes and frames it. ## Implements [Section titled “Implements”](#implements) * [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/) ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new Serial(port, opts?): SerialTransport;
```
Defined in: [src/transports/serialTransport.ts:28](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L28) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------------------- | ----------------------------------------------------------------------------------------------- | | `port` | [`SerialPortLike`](/meshcore-ts/api/andyshinn/namespaces/transports/interfaces/serialportlike/) | | `opts?` | { `maxFrameBytes?`: `number`; } | | `opts.maxFrameBytes?` | `number` | #### Returns [Section titled “Returns”](#returns) `SerialTransport` ## Methods [Section titled “Methods”](#methods) ### getState() [Section titled “getState()”](#getstate)
```ts
getState(): TransportState;
```
Defined in: [src/transports/serialTransport.ts:61](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L61) #### Returns [Section titled “Returns”](#returns-1) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) #### Implementation of [Section titled “Implementation of”](#implementation-of) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`getState`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#getstate) *** ### onData() [Section titled “onData()”](#ondata)
```ts
onData(cb): void;
```
Defined in: [src/transports/serialTransport.ts:53](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L53) Each chunk is ONE complete companion frame (a BLE notification payload). #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ------------------- | | `cb` | (`chunk`) => `void` | #### Returns [Section titled “Returns”](#returns-2) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-1) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onData`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#ondata) *** ### onStateChange() [Section titled “onStateChange()”](#onstatechange)
```ts
onStateChange(cb): void;
```
Defined in: [src/transports/serialTransport.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L57) #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | --------------- | | `cb` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-3) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-2) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onStateChange`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#onstatechange) *** ### send() [Section titled “send()”](#send)
```ts
send(bytes): Promise;
```
Defined in: [src/transports/serialTransport.ts:49](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L49) Write one complete companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-4) `Promise`<`void`> #### Implementation of [Section titled “Implementation of”](#implementation-of-3) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`send`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#send)
# SerialDeframer
Defined in: [src/transports/serialFraming.ts:29](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialFraming.ts#L29) Resync-tolerant de-framer for the MeshCore serial byte stream. Feed it raw bytes as they arrive; it returns zero or more complete companion-frame payloads, buffering any partial tail. Never throws on malformed input — it drops a byte and resyncs. ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new SerialDeframer(opts?): SerialDeframer;
```
Defined in: [src/transports/serialFraming.ts:33](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialFraming.ts#L33) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------------------- | ------------------------------- | | `opts?` | { `maxFrameBytes?`: `number`; } | | `opts.maxFrameBytes?` | `number` | #### Returns [Section titled “Returns”](#returns) `SerialDeframer` ## Methods [Section titled “Methods”](#methods) ### push() [Section titled “push()”](#push)
```ts
push(bytes): Uint8Array[];
```
Defined in: [src/transports/serialFraming.ts:43](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialFraming.ts#L43) Append bytes and return every complete companion-frame payload now available. #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-1) `Uint8Array`<`ArrayBufferLike`>\[] *** ### reset() [Section titled “reset()”](#reset)
```ts
reset(): void;
```
Defined in: [src/transports/serialFraming.ts:38](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialFraming.ts#L38) Discard any buffered partial frame. #### Returns [Section titled “Returns”](#returns-2) `void`
# Tcp
Defined in: [src/transports/tcpTransport.ts:46](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L46) Complete, batteries-included TCP transport for the MeshCore companion protocol. Unlike Serial/BLE (which are bring-your-own-driver adapters), TCP’s only driver is the `node:net` builtin, so this transport owns its socket and its connect/close lifecycle. The wire framing is identical to serial (`[0x3c]`/`[0x3e][uint16 LE length][payload]`), so it reuses `SerialDeframer` + `encodeSerialFrame` rather than reimplementing framing. ## Implements [Section titled “Implements”](#implements) * [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/) ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new Tcp(opts): TcpTransport;
```
Defined in: [src/transports/tcpTransport.ts:57](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L57) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------------------- | | `opts` | [`TcpTransportOptions`](/meshcore-ts/api/andyshinn/namespaces/transports/interfaces/tcptransportoptions/) | #### Returns [Section titled “Returns”](#returns) `TcpTransport` ## Methods [Section titled “Methods”](#methods) ### close() [Section titled “close()”](#close)
```ts
close(): Promise;
```
Defined in: [src/transports/tcpTransport.ts:117](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L117) Destroy the socket and return to idle. Safe to call when never connected. #### Returns [Section titled “Returns”](#returns-1) `Promise`<`void`> *** ### connect() [Section titled “connect()”](#connect)
```ts
connect(): Promise;
```
Defined in: [src/transports/tcpTransport.ts:69](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L69) Dial host:port. Resolves on the socket’s ‘connect’ event, rejects on a socket ‘error’ or if no connection completes within connectTimeoutMs. #### Returns [Section titled “Returns”](#returns-2) `Promise`<`void`> *** ### getState() [Section titled “getState()”](#getstate)
```ts
getState(): TransportState;
```
Defined in: [src/transports/tcpTransport.ts:142](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L142) #### Returns [Section titled “Returns”](#returns-3) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) #### Implementation of [Section titled “Implementation of”](#implementation-of) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`getState`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#getstate) *** ### onData() [Section titled “onData()”](#ondata)
```ts
onData(cb): void;
```
Defined in: [src/transports/tcpTransport.ts:134](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L134) Each chunk is ONE complete companion frame (a BLE notification payload). #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ------------------- | | `cb` | (`chunk`) => `void` | #### Returns [Section titled “Returns”](#returns-4) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-1) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onData`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#ondata) *** ### onStateChange() [Section titled “onStateChange()”](#onstatechange)
```ts
onStateChange(cb): void;
```
Defined in: [src/transports/tcpTransport.ts:138](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L138) #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | --------------- | | `cb` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-5) `void` #### Implementation of [Section titled “Implementation of”](#implementation-of-2) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`onStateChange`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#onstatechange) *** ### send() [Section titled “send()”](#send)
```ts
send(bytes): Promise;
```
Defined in: [src/transports/tcpTransport.ts:129](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L129) Write one complete companion frame to the radio. #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-6) `Promise`<`void`> #### Implementation of [Section titled “Implementation of”](#implementation-of-3) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/).[`send`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/#send)
# createBle
```ts
function createBle(hooks): Transport;
```
Defined in: [src/transports/bleTransport.ts:37](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L37) Build a Transport from BLE I/O hooks. BLE notifications are already whole companion frames, so there is no framing here. The user owns the connection; state defaults to ‘connected’ (you have characteristics to talk to) and follows `watchState` thereafter. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------- | | `hooks` | [`BleHooks`](/meshcore-ts/api/andyshinn/namespaces/transports/interfaces/blehooks/) | ## Returns [Section titled “Returns”](#returns) [`Transport`](/meshcore-ts/api/andyshinn/namespaces/ports/interfaces/transport/)
# createTcp
```ts
function createTcp(opts): Tcp;
```
Defined in: [src/transports/tcpTransport.ts:153](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L153) Factory mirroring createBleTransport — returns a ready-to-connect TcpTransport. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------------------- | | `opts` | [`TcpTransportOptions`](/meshcore-ts/api/andyshinn/namespaces/transports/interfaces/tcptransportoptions/) | ## Returns [Section titled “Returns”](#returns) [`Tcp`](/meshcore-ts/api/andyshinn/namespaces/transports/classes/tcp/)
# encodeSerialFrame
```ts
function encodeSerialFrame(payload): Uint8Array;
```
Defined in: [src/transports/serialFraming.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialFraming.ts#L14) Wrap one companion frame as a host→device serial frame: \[0x3c]\[len LE]\[payload]. ## Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------ | | `payload` | `Uint8Array` | ## Returns [Section titled “Returns”](#returns) `Uint8Array`
# BleHooks
Defined in: [src/transports/bleTransport.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L15) I/O hooks the caller binds to their BLE library (noble, react-native-ble-plx, …). ## Methods [Section titled “Methods”](#methods) ### subscribe() [Section titled “subscribe()”](#subscribe)
```ts
subscribe(onBytes): void;
```
Defined in: [src/transports/bleTransport.ts:26](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L26) Register a notification handler for the TX characteristic. Each notification delivered to `onBytes` is ONE complete companion frame (no framing on BLE). #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------- | | `onBytes` | (`frame`) => `void` | #### Returns [Section titled “Returns”](#returns) `void` *** ### watchState()? [Section titled “watchState()?”](#watchstate)
```ts
optional watchState(onState): void;
```
Defined in: [src/transports/bleTransport.ts:28](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L28) Optional: map connect/disconnect to transport state. #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------- | | `onState` | (`s`) => `void` | #### Returns [Section titled “Returns”](#returns-1) `void` *** ### write() [Section titled “write()”](#write)
```ts
write(bytes): void | Promise;
```
Defined in: [src/transports/bleTransport.ts:21](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L21) Write one companion frame to the RX characteristic. Callers receive raw bytes; encode as your BLE library requires (e.g. base64 for react-native-ble-plx, Buffer/Uint8Array for noble). #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-2) `void` | `Promise`<`void`>
# SerialPortLike
Defined in: [src/transports/serialTransport.ts:9](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L9) Minimal structural view of a node-serialport-style handle. The user passes their own already-constructed port; meshcore-ts never imports serialport. ## Properties [Section titled “Properties”](#properties) ### isOpen? [Section titled “isOpen?”](#isopen)
```ts
readonly optional isOpen?: boolean;
```
Defined in: [src/transports/serialTransport.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L11) ## Methods [Section titled “Methods”](#methods) ### on() [Section titled “on()”](#on) #### Call Signature [Section titled “Call Signature”](#call-signature)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/serialTransport.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L12) ##### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------- | | `event` | `"data"` | | `cb` | (`chunk`) => `void` | ##### Returns [Section titled “Returns”](#returns) `unknown` #### Call Signature [Section titled “Call Signature”](#call-signature-1)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/serialTransport.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L13) ##### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | --------------------- | | `event` | `"open"` \| `"close"` | | `cb` | () => `void` | ##### Returns [Section titled “Returns”](#returns-1) `unknown` #### Call Signature [Section titled “Call Signature”](#call-signature-2)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/serialTransport.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L14) ##### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ----------------- | | `event` | `"error"` | | `cb` | (`err`) => `void` | ##### Returns [Section titled “Returns”](#returns-2) `unknown` *** ### write() [Section titled “write()”](#write)
```ts
write(bytes): unknown;
```
Defined in: [src/transports/serialTransport.ts:10](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/serialTransport.ts#L10) #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-3) `unknown`
# SocketLike
Defined in: [src/transports/tcpTransport.ts:11](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L11) Minimal structural view of a node:net Socket — satisfied by a real `net.Socket` and by test fakes. Mirrors the duck-typed `SerialPortLike`: we only touch the few members the transport actually uses. ## Properties [Section titled “Properties”](#properties) ### destroyed? [Section titled “destroyed?”](#destroyed)
```ts
readonly optional destroyed?: boolean;
```
Defined in: [src/transports/tcpTransport.ts:14](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L14) ## Methods [Section titled “Methods”](#methods) ### destroy() [Section titled “destroy()”](#destroy)
```ts
destroy(): unknown;
```
Defined in: [src/transports/tcpTransport.ts:13](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L13) #### Returns [Section titled “Returns”](#returns) `unknown` *** ### on() [Section titled “on()”](#on) #### Call Signature [Section titled “Call Signature”](#call-signature)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/tcpTransport.ts:15](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L15) ##### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------------ | | `event` | `"close"` \| `"connect"` | | `cb` | () => `void` | ##### Returns [Section titled “Returns”](#returns-1) `unknown` #### Call Signature [Section titled “Call Signature”](#call-signature-1)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/tcpTransport.ts:16](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L16) ##### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | --------- | ------------------- | | `event` | `"data"` | | `cb` | (`chunk`) => `void` | ##### Returns [Section titled “Returns”](#returns-2) `unknown` #### Call Signature [Section titled “Call Signature”](#call-signature-2)
```ts
on(event, cb): unknown;
```
Defined in: [src/transports/tcpTransport.ts:17](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L17) ##### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | ----------------- | | `event` | `"error"` | | `cb` | (`err`) => `void` | ##### Returns [Section titled “Returns”](#returns-3) `unknown` *** ### write() [Section titled “write()”](#write)
```ts
write(bytes): unknown;
```
Defined in: [src/transports/tcpTransport.ts:12](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L12) #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | --------- | ------------ | | `bytes` | `Uint8Array` | #### Returns [Section titled “Returns”](#returns-4) `unknown`
# TcpTransportOptions
Defined in: [src/transports/tcpTransport.ts:20](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L20) ## Properties [Section titled “Properties”](#properties) ### connectTimeoutMs? [Section titled “connectTimeoutMs?”](#connecttimeoutms)
```ts
optional connectTimeoutMs?: number;
```
Defined in: [src/transports/tcpTransport.ts:26](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L26) Reject connect() if no ‘connect’ arrives within this many ms. Default 10000. *** ### createSocket? [Section titled “createSocket?”](#createsocket)
```ts
optional createSocket?: (host, port) => SocketLike;
```
Defined in: [src/transports/tcpTransport.ts:33](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L33) Test seam: build the socket. Defaults to `net.createConnection`, which both creates the socket and starts dialing — so connect() just waits for events. #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | -------- | | `host` | `string` | | `port` | `number` | #### Returns [Section titled “Returns”](#returns) [`SocketLike`](/meshcore-ts/api/andyshinn/namespaces/transports/interfaces/socketlike/) *** ### host [Section titled “host”](#host)
```ts
host: string;
```
Defined in: [src/transports/tcpTransport.ts:22](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L22) Host to dial. *** ### maxFrameBytes? [Section titled “maxFrameBytes?”](#maxframebytes)
```ts
optional maxFrameBytes?: number;
```
Defined in: [src/transports/tcpTransport.ts:28](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L28) Max companion-frame payload size for the de-framer. Default 256. *** ### port [Section titled “port”](#port)
```ts
port: number;
```
Defined in: [src/transports/tcpTransport.ts:24](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/tcpTransport.ts#L24) TCP port to dial.
# NORDIC_UART
```ts
const NORDIC_UART: object;
```
Defined in: [src/transports/bleTransport.ts:8](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/transports/bleTransport.ts#L8) Nordic UART Service UUIDs used by the MeshCore companion BLE interface. Compare case-insensitively — some stacks (e.g. noble) report UUIDs lowercase. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### rxWrite [Section titled “rxWrite”](#rxwrite)
```ts
readonly rxWrite: "6E400002-B5A3-F393-E0A9-E50E24DCCA9E" = '6E400002-B5A3-F393-E0A9-E50E24DCCA9E';
```
### service [Section titled “service”](#service)
```ts
readonly service: "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" = '6E400001-B5A3-F393-E0A9-E50E24DCCA9E';
```
### txNotify [Section titled “txNotify”](#txnotify)
```ts
readonly txNotify: "6E400003-B5A3-F393-E0A9-E50E24DCCA9E" = '6E400003-B5A3-F393-E0A9-E50E24DCCA9E';
```
# MeshCoreSession
Defined in: [src/session/session.ts:137](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L137) The protocol session core: owns the inbound-frame ingest, the reply- correlation FIFOs (ack + typed), the handshake, the liveness poll, and the transport-state lifecycle. Feature modules receive a [FeatureContext](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/featurecontext/) bound to this session and own their own wire codes via the registry. Ported verbatim from the donor `ProtocolSession`; the \~60 user-facing command methods are layered on in a later task. ## Constructors [Section titled “Constructors”](#constructors) ### Constructor [Section titled “Constructor”](#constructor)
```ts
new MeshCoreSession(opts): MeshCoreSession;
```
Defined in: [src/session/session.ts:207](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L207) #### Parameters [Section titled “Parameters”](#parameters) | Parameter | Type | | --------- | ------------------------------------------------------------------------------- | | `opts` | [`MeshCoreSessionOptions`](/meshcore-ts/api/interfaces/meshcoresessionoptions/) | #### Returns [Section titled “Returns”](#returns) `MeshCoreSession` ## Properties [Section titled “Properties”](#properties) ### admin [Section titled “admin”](#admin)
```ts
readonly admin: AdminSessionStore;
```
Defined in: [src/session/session.ts:147](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L147) Repeater admin auth + pending-request store. *** ### events [Section titled “events”](#events)
```ts
readonly events: Events;
```
Defined in: [src/session/session.ts:143](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L143) Typed event bus the session and consumers subscribe to. *** ### log [Section titled “log”](#log)
```ts
readonly log: Logger;
```
Defined in: [src/session/session.ts:149](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L149) Structured logger (defaults to no-op). *** ### rt [Section titled “rt”](#rt)
```ts
readonly rt: SessionRuntime;
```
Defined in: [src/session/session.ts:151](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L151) Per-session mutable feature state. *** ### state [Section titled “state”](#state)
```ts
readonly state: SessionState;
```
Defined in: [src/session/session.ts:145](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L145) In-memory session model. ## Methods [Section titled “Methods”](#methods) ### addContactToRadio() [Section titled “addContactToRadio()”](#addcontacttoradio)
```ts
addContactToRadio(publicKeyHex): Promise;
```
Defined in: [src/session/session.ts:883](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L883) Commit a discovered contact to the radio’s store (CMD\_ADD\_UPDATE\_CONTACT). Awaits the radio’s RESP\_OK/ERR before marking the contact on-radio. #### Parameters [Section titled “Parameters”](#parameters-1) | Parameter | Type | | -------------- | -------- | | `publicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-1) `Promise`<`void`> *** ### clearDefaultFloodScope() [Section titled “clearDefaultFloodScope()”](#cleardefaultfloodscope)
```ts
clearDefaultFloodScope(): Promise;
```
Defined in: [src/session/session.ts:1391](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1391) Clear the persisted default flood scope. #### Returns [Section titled “Returns”](#returns-2) `Promise`<`void`> *** ### deriveSecret() [Section titled “deriveSecret()”](#derivesecret)
```ts
deriveSecret(name): string;
```
Defined in: [src/session/session.ts:1103](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1103) Derive the 16-byte secret for a public/hashtag channel by name. Callers supplying their own secret (e.g. private channel imported from a share link) should pass it directly to setChannel instead. #### Parameters [Section titled “Parameters”](#parameters-2) | Parameter | Type | | --------- | -------- | | `name` | `string` | #### Returns [Section titled “Returns”](#returns-3) `string` *** ### exportContact() [Section titled “exportContact()”](#exportcontact)
```ts
exportContact(destPublicKeyHex?): Promise;
```
Defined in: [src/session/session.ts:1486](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1486) Export an advert blob for the device (no arg) or a known contact, or null when the contact isn’t found. #### Parameters [Section titled “Parameters”](#parameters-3) | Parameter | Type | | ------------------- | -------- | | `destPublicKeyHex?` | `string` | #### Returns [Section titled “Returns”](#returns-4) `Promise`<`string` | `null`> *** ### exportPrivateKey() [Section titled “exportPrivateKey()”](#exportprivatekey)
```ts
exportPrivateKey(): Promise;
```
Defined in: [src/session/session.ts:1414](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1414) Export the device’s 64-byte private key (hex). Rejects FeatureDisabledError on a firmware build with private-key export compiled out. #### Returns [Section titled “Returns”](#returns-5) `Promise`<`string`> *** ### factoryReset() [Section titled “factoryReset()”](#factoryreset)
```ts
factoryReset(): Promise;
```
Defined in: [src/session/session.ts:1431](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1431) Wipe the device to factory state. The link drops mid-reset, so there is no reply to await (like reboot()). #### Returns [Section titled “Returns”](#returns-6) `Promise`<`void`> *** ### findChannelByName() [Section titled “findChannelByName()”](#findchannelbyname)
```ts
findChannelByName(name):
| Channel
| null;
```
Defined in: [src/session/session.ts:1017](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1017) Find a channel in current session state by exact name, or null. #### Parameters [Section titled “Parameters”](#parameters-4) | Parameter | Type | | --------- | -------- | | `name` | `string` | #### Returns [Section titled “Returns”](#returns-7) \| [`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/) | `null` *** ### findChannelBySecret() [Section titled “findChannelBySecret()”](#findchannelbysecret)
```ts
findChannelBySecret(secretHex):
| Channel
| null;
```
Defined in: [src/session/session.ts:1023](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1023) Find a channel by its secret (hex, case-insensitive exact match). A mismatched-length input simply returns null (no validation). #### Parameters [Section titled “Parameters”](#parameters-5) | Parameter | Type | | ----------- | -------- | | `secretHex` | `string` | #### Returns [Section titled “Returns”](#returns-8) \| [`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/) | `null` *** ### findContactByName() [Section titled “findContactByName()”](#findcontactbyname)
```ts
findContactByName(name):
| Contact
| null;
```
Defined in: [src/session/session.ts:1004](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1004) Find a contact in current session state by exact display name, or null. #### Parameters [Section titled “Parameters”](#parameters-6) | Parameter | Type | | --------- | -------- | | `name` | `string` | #### Returns [Section titled “Returns”](#returns-9) \| [`Contact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contact/) | `null` *** ### findContactByPublicKeyPrefix() [Section titled “findContactByPublicKeyPrefix()”](#findcontactbypublickeyprefix)
```ts
findContactByPublicKeyPrefix(prefixHex):
| Contact
| null;
```
Defined in: [src/session/session.ts:1010](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1010) Find a contact whose public key starts with the given hex prefix (case-insensitive), or null. #### Parameters [Section titled “Parameters”](#parameters-7) | Parameter | Type | | ----------- | -------- | | `prefixHex` | `string` | #### Returns [Section titled “Returns”](#returns-10) \| [`Contact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contact/) | `null` *** ### getAdvertPath() [Section titled “getAdvertPath()”](#getadvertpath)
```ts
getAdvertPath(contactKey): Promise<
| AdvertPath
| null>;
```
Defined in: [src/session/session.ts:1451](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1451) The device’s cached advert path for a contact, or null when none is cached. #### Parameters [Section titled “Parameters”](#parameters-8) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-11) `Promise`< | [`AdvertPath`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/advertpath/) | `null`> *** ### getAllowedRepeatFreq() [Section titled “getAllowedRepeatFreq()”](#getallowedrepeatfreq)
```ts
getAllowedRepeatFreq(): Promise;
```
Defined in: [src/session/session.ts:1406](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1406) The frequency ranges the radio is allowed to repeat on (region-dependent). #### Returns [Section titled “Returns”](#returns-12) `Promise`<[`RepeatFreqRange`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/repeatfreqrange/)\[]> *** ### getChannel() [Section titled “getChannel()”](#getchannel)
```ts
getChannel(idx): Promise<
| Channel
| null>;
```
Defined in: [src/session/session.ts:1068](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1068) Actively re-query a single channel slot. Intended for use while connected; on a dead link it resolves only after the watchdog/request timeout. #### Parameters [Section titled “Parameters”](#parameters-9) | Parameter | Type | | --------- | -------- | | `idx` | `number` | #### Returns [Section titled “Returns”](#returns-13) `Promise`< | [`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/) | `null`> *** ### getChannels() [Section titled “getChannels()”](#getchannels)
```ts
getChannels(): Promise;
```
Defined in: [src/session/session.ts:1057](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1057) Actively re-enumerate channel slots (GET\_CHANNEL 0..N-1) and resolve the fresh list. Intended for use while connected; on a dead link it resolves only after the watchdog/request timeout. #### Returns [Section titled “Returns”](#returns-14) `Promise`<[`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/)\[]> *** ### getContactByKey() [Section titled “getContactByKey()”](#getcontactbykey)
```ts
getContactByKey(destPublicKeyHex): Promise<
| ContactRecord
| null>;
```
Defined in: [src/session/session.ts:999](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L999) Look up a single contact on the radio by public key, or null if absent. #### Parameters [Section titled “Parameters”](#parameters-10) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-15) `Promise`< | [`ContactRecord`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contactrecord/) | `null`> *** ### getContacts() [Section titled “getContacts()”](#getcontacts)
```ts
getContacts(): Promise;
```
Defined in: [src/session/session.ts:1043](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1043) Actively re-enumerate the radio’s contact store (GET\_CONTACTS) and resolve the fresh list. Reuses the handshake’s contact-stream waiters. Intended for use while connected; on a dead link it resolves only after the watchdog/request timeout. #### Returns [Section titled “Returns”](#returns-16) `Promise`<[`Contact`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/contact/)\[]> *** ### getDefaultFloodScope() [Section titled “getDefaultFloodScope()”](#getdefaultfloodscope)
```ts
getDefaultFloodScope(): Promise<
| DefaultFloodScope
| null>;
```
Defined in: [src/session/session.ts:1396](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1396) Read the persisted default flood scope, or null when none is set. #### Returns [Section titled “Returns”](#returns-17) `Promise`< | [`DefaultFloodScope`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/defaultfloodscope/) | `null`> *** ### getDevicePresence() [Section titled “getDevicePresence()”](#getdevicepresence)
```ts
getDevicePresence(): string[];
```
Defined in: [src/session/session.ts:560](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L560) Snapshot of channel keys currently present on the radio. Empty when the transport is disconnected. #### Returns [Section titled “Returns”](#returns-18) `string`\[] *** ### getDeviceTime() [Section titled “getDeviceTime()”](#getdevicetime)
```ts
getDeviceTime(): Promise;
```
Defined in: [src/session/session.ts:1346](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1346) Read the radio’s RTC clock (unix seconds). #### Returns [Section titled “Returns”](#returns-19) `Promise`<`number`> *** ### getSelfInfo() [Section titled “getSelfInfo()”](#getselfinfo)
```ts
getSelfInfo(): Promise;
```
Defined in: [src/session/session.ts:1031](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1031) Actively re-query the radio’s self-info (APP\_START → RESP\_SELF\_INFO), publish it as the Owner, and return it. Intended for use while connected; on a dead link it resolves only after the watchdog/request timeout. #### Returns [Section titled “Returns”](#returns-20) `Promise`<[`SelfInfo`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/selfinfo/)> *** ### getSyncProgress() [Section titled “getSyncProgress()”](#getsyncprogress)
```ts
getSyncProgress(): SyncProgress;
```
Defined in: [src/session/session.ts:565](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L565) Snapshot of handshake progress. #### Returns [Section titled “Returns”](#returns-21) [`SyncProgress`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/syncprogress/) *** ### getTransportState() [Section titled “getTransportState()”](#gettransportstate)
```ts
getTransportState(): TransportState;
```
Defined in: [src/session/session.ts:268](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L268) Current transport connection state. #### Returns [Section titled “Returns”](#returns-22) [`TransportState`](/meshcore-ts/api/andyshinn/namespaces/models/type-aliases/transportstate/) *** ### getTuningParams() [Section titled “getTuningParams()”](#gettuningparams)
```ts
getTuningParams(): Promise;
```
Defined in: [src/session/session.ts:1364](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1364) Read the radio airtime/backoff tuning params (CMD\_GET\_TUNING\_PARAMS). #### Returns [Section titled “Returns”](#returns-23) `Promise`<[`TuningParams`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/tuningparams/)> *** ### hasConnection() [Section titled “hasConnection()”](#hasconnection)
```ts
hasConnection(destPublicKeyHex): Promise;
```
Defined in: [src/session/session.ts:1401](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1401) Whether the radio reports an active connection to a node. #### Parameters [Section titled “Parameters”](#parameters-11) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-24) `Promise`<`boolean`> *** ### importContact() [Section titled “importContact()”](#importcontact)
```ts
importContact(blobHex): Promise;
```
Defined in: [src/session/session.ts:1491](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1491) Import a contact from a serialized advert blob (CMD\_IMPORT\_CONTACT). #### Parameters [Section titled “Parameters”](#parameters-12) | Parameter | Type | | --------- | -------- | | `blobHex` | `string` | #### Returns [Section titled “Returns”](#returns-25) `Promise`<`void`> *** ### importPrivateKey() [Section titled “importPrivateKey()”](#importprivatekey)
```ts
importPrivateKey(privKeyHex): Promise;
```
Defined in: [src/session/session.ts:1420](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1420) Import a 64-byte private key (hex), replacing the device identity. Rejects ProtocolError on a bad key / FS error. #### Parameters [Section titled “Parameters”](#parameters-13) | Parameter | Type | | ------------ | -------- | | `privKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-26) `Promise`<`void`> *** ### markChannelAbsent() [Section titled “markChannelAbsent()”](#markchannelabsent)
```ts
markChannelAbsent(idx): void;
```
Defined in: [src/session/session.ts:1091](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1091) Mark a slot as no longer on the device (paired with a zero-key write). Frees the slot for pickFreeSlot and clears the presence flag. #### Parameters [Section titled “Parameters”](#parameters-14) | Parameter | Type | | --------- | -------- | | `idx` | `number` | #### Returns [Section titled “Returns”](#returns-27) `void` *** ### markChannelPresent() [Section titled “markChannelPresent()”](#markchannelpresent)
```ts
markChannelPresent(channel): void;
```
Defined in: [src/session/session.ts:1085](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1085) Mark a channel as present on the device. Call after a successful SET\_CHANNEL ack — the firmware doesn’t echo CHANNEL\_INFO back, so without this the new channel would stay grayed-out in the UI until the next full re-enumeration. #### Parameters [Section titled “Parameters”](#parameters-15) | Parameter | Type | | --------- | ----------------------------------------------------------------------------- | | `channel` | [`Channel`](/meshcore-ts/api/andyshinn/namespaces/models/interfaces/channel/) | #### Returns [Section titled “Returns”](#returns-28) `void` *** ### pickFreeSlot() [Section titled “pickFreeSlot()”](#pickfreeslot)
```ts
pickFreeSlot(): number | null;
```
Defined in: [src/session/session.ts:1096](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1096) Lowest unused slot index in 0..15, or null if all 16 are taken. #### Returns [Section titled “Returns”](#returns-29) `number` | `null` *** ### reboot() [Section titled “reboot()”](#reboot)
```ts
reboot(): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:1291](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1291) Reboot the connected device. The link drops within a few hundred ms; the transport state machine will reflect that via its own state push. #### Returns [Section titled “Returns”](#returns-30) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### registerChannelSend() [Section titled “registerChannelSend()”](#registerchannelsend)
```ts
registerChannelSend(params): void;
```
Defined in: [src/session/session.ts:778](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L778) Track an outgoing channel send so heard repeater relays (0x88) are attributed back to it (emits ‘messagePathHeard’). Call after sendChannelText returns a channelHash, passing your message id. #### Parameters [Section titled “Parameters”](#parameters-16) | Parameter | Type | | -------------------- | ------------------------------------------------------------------------ | | `params` | { `channelHash`: `number`; `messageId`: `string`; `sentAt?`: `number`; } | | `params.channelHash` | `number` | | `params.messageId` | `string` | | `params.sentAt?` | `number` | #### Returns [Section titled “Returns”](#returns-31) `void` *** ### removeContactFromRadio() [Section titled “removeContactFromRadio()”](#removecontactfromradio)
```ts
removeContactFromRadio(publicKeyHex): Promise;
```
Defined in: [src/session/session.ts:936](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L936) Delete a contact from the radio’s store (CMD\_REMOVE\_CONTACT). Keeps it in the discovered pool, flagged off-radio. #### Parameters [Section titled “Parameters”](#parameters-17) | Parameter | Type | | -------------- | -------- | | `publicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-32) `Promise`<`void`> *** ### repeaterGetLocalStats() [Section titled “repeaterGetLocalStats()”](#repeatergetlocalstats)
```ts
repeaterGetLocalStats(subtype): Promise;
```
Defined in: [src/session/session.ts:1584](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1584) CMD\_GET\_STATS — local stats for the directly-connected device. #### Parameters [Section titled “Parameters”](#parameters-18) | Parameter | Type | | --------- | ------------------------------------ | | `subtype` | `"CORE"` \| `"RADIO"` \| `"PACKETS"` | #### Returns [Section titled “Returns”](#returns-33) `Promise`<[`LocalStats`](/meshcore-ts/api/andyshinn/namespaces/protocol/type-aliases/localstats/)> *** ### repeaterLogin() [Section titled “repeaterLogin()”](#repeaterlogin)
```ts
repeaterLogin(contactKey, password): Promise;
```
Defined in: [src/session/session.ts:1512](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1512) Login to a repeater via CMD\_SEND\_LOGIN — the radio routes it (direct when the contact’s out\_path is known, flood otherwise). An empty `password` is a guest login. Returns the effective mode so the UI can label the toast (Direct / Flood / N-hop). #### Parameters [Section titled “Parameters”](#parameters-19) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | | `password` | `string` | #### Returns [Section titled “Returns”](#returns-34) `Promise`<[`LoginSuccess`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/loginsuccess/) & `object`> *** ### repeaterLogout() [Section titled “repeaterLogout()”](#repeaterlogout)
```ts
repeaterLogout(contactKey): Promise;
```
Defined in: [src/session/session.ts:1519](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1519) #### Parameters [Section titled “Parameters”](#parameters-20) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-35) `Promise`<`void`> *** ### repeaterRequestAcl() [Section titled “repeaterRequestAcl()”](#repeaterrequestacl)
```ts
repeaterRequestAcl(contactKey): Promise;
```
Defined in: [src/session/session.ts:1524](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1524) Request the ACL list. Admin-only (firmware returns nothing if guest). #### Parameters [Section titled “Parameters”](#parameters-21) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-36) `Promise`<[`AclEntry`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/aclentry/)\[]> *** ### repeaterRequestAvgMinMax() [Section titled “repeaterRequestAvgMinMax()”](#repeaterrequestavgminmax)
```ts
repeaterRequestAvgMinMax(contactKey, opts): Promise;
```
Defined in: [src/session/session.ts:1566](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1566) Request a min/max/avg series window from a sensor contact. #### Parameters [Section titled “Parameters”](#parameters-22) | Parameter | Type | | ------------------- | ----------------------------------------------------- | | `contactKey` | `string` | | `opts` | { `endSecsAgo`: `number`; `startSecsAgo`: `number`; } | | `opts.endSecsAgo` | `number` | | `opts.startSecsAgo` | `number` | #### Returns [Section titled “Returns”](#returns-37) `Promise`<[`AvgMinMaxResult`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/avgminmaxresult/)> *** ### repeaterRequestClock() [Section titled “repeaterRequestClock()”](#repeaterrequestclock)
```ts
repeaterRequestClock(contactKey): Promise;
```
Defined in: [src/session/session.ts:1554](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1554) Public anon CLOCK request — the repeater’s RTC clock (unix seconds). #### Parameters [Section titled “Parameters”](#parameters-23) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-38) `Promise`<`number`> *** ### repeaterRequestNeighbours() [Section titled “repeaterRequestNeighbours()”](#repeaterrequestneighbours)
```ts
repeaterRequestNeighbours(contactKey, opts?): Promise;
```
Defined in: [src/session/session.ts:1528](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1528) #### Parameters [Section titled “Parameters”](#parameters-24) | Parameter | Type | | ----------------- | ------------------------------------------------------------------------------------------ | | `contactKey` | `string` | | `opts` | { `count?`: `number`; `offset?`: `number`; `orderBy?`: `number`; `prefixLen?`: `number`; } | | `opts.count?` | `number` | | `opts.offset?` | `number` | | `opts.orderBy?` | `number` | | `opts.prefixLen?` | `number` | #### Returns [Section titled “Returns”](#returns-39) `Promise`<[`NeighboursPage`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/neighbourspage/)> *** ### repeaterRequestOwnerInfo() [Section titled “repeaterRequestOwnerInfo()”](#repeaterrequestownerinfo)
```ts
repeaterRequestOwnerInfo(contactKey): Promise<
| OwnerInfo
| null>;
```
Defined in: [src/session/session.ts:1537](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1537) Fetch a repeater’s owner info via the PUBLIC anon OWNER request (works without a login). Returns null if the response can’t be parsed. #### Parameters [Section titled “Parameters”](#parameters-25) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-40) `Promise`< | [`OwnerInfo`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/ownerinfo/) | `null`> *** ### repeaterRequestRegions() [Section titled “repeaterRequestRegions()”](#repeaterrequestregions)
```ts
repeaterRequestRegions(contactKey): Promise;
```
Defined in: [src/session/session.ts:1549](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1549) Public anon REGIONS request — the repeater’s region-name listing. #### Parameters [Section titled “Parameters”](#parameters-26) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-41) `Promise`<`string`> *** ### repeaterSendCli() [Section titled “repeaterSendCli()”](#repeatersendcli)
```ts
repeaterSendCli(contactKey, command): Promise;
```
Defined in: [src/session/session.ts:1574](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1574) Send a remote CLI command; the reply is routed back by sender prefix. #### Parameters [Section titled “Parameters”](#parameters-27) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | | `command` | `string` | #### Returns [Section titled “Returns”](#returns-42) `Promise`<`string`> *** ### repeaterTracePath() [Section titled “repeaterTracePath()”](#repeatertracepath)
```ts
repeaterTracePath(opts): Promise;
```
Defined in: [src/session/session.ts:1579](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1579) CMD\_SEND\_TRACE\_PATH — diagnostic trace along a known path. #### Parameters [Section titled “Parameters”](#parameters-28) | Parameter | Type | | --------------- | ----------------------------------------------------------------------------------- | | `opts` | { `authCode`: `number`; `flags?`: `number`; `pathHex`: `string`; `tag`: `number`; } | | `opts.authCode` | `number` | | `opts.flags?` | `number` | | `opts.pathHex` | `string` | | `opts.tag` | `number` | #### Returns [Section titled “Returns”](#returns-43) `Promise`<[`TraceData`](/meshcore-ts/api/andyshinn/namespaces/protocol/interfaces/tracedata/)> *** ### requestAutoAddConfig() [Section titled “requestAutoAddConfig()”](#requestautoaddconfig)
```ts
requestAutoAddConfig(): Promise;
```
Defined in: [src/session/session.ts:1254](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1254) Ask the radio for its current auto-add flags. RESP\_AUTOADD\_CONFIG lands in the feature handler → updates state + emits. #### Returns [Section titled “Returns”](#returns-44) `Promise`<`void`> *** ### requestBattAndStorage() [Section titled “requestBattAndStorage()”](#requestbattandstorage)
```ts
requestBattAndStorage(): Promise;
```
Defined in: [src/session/session.ts:1302](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1302) Query battery + storage. Replies land in onPacket and update DeviceInfo. #### Returns [Section titled “Returns”](#returns-45) `Promise`<`void`> *** ### requestCustomVars() [Section titled “requestCustomVars()”](#requestcustomvars)
```ts
requestCustomVars(key?): Promise;
```
Defined in: [src/session/session.ts:1323](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1323) Query the firmware’s custom-var store (“gps”, “gps\_interval”, etc.). Empty key requests all known keys. Reply: RESP\_CUSTOM\_VARS. #### Parameters [Section titled “Parameters”](#parameters-29) | Parameter | Type | Default value | | --------- | -------- | ------------- | | `key` | `string` | `''` | #### Returns [Section titled “Returns”](#returns-46) `Promise`<`void`> *** ### requestDeviceInfo() [Section titled “requestDeviceInfo()”](#requestdeviceinfo)
```ts
requestDeviceInfo(): Promise;
```
Defined in: [src/session/session.ts:1312](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1312) Re-issue DEVICE\_QUERY to refresh DeviceInfo + capabilities. #### Returns [Section titled “Returns”](#returns-47) `Promise`<`void`> *** ### resetContactPath() [Section titled “resetContactPath()”](#resetcontactpath)
```ts
resetContactPath(contactKey): Promise;
```
Defined in: [src/session/session.ts:862](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L862) Drop a contact’s path back to flood. Mirrors CMD\_RESET\_PATH. #### Parameters [Section titled “Parameters”](#parameters-30) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-48) `Promise`<`void`> *** ### sendAnonReq() [Section titled “sendAnonReq()”](#sendanonreq)
```ts
sendAnonReq(contactKey, anonType): Promise>;
```
Defined in: [src/session/session.ts:1544](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1544) Low-level public anon request (CMD\_SEND\_ANON\_REQ). `anonType` is one of Protocol.ANON\_REQ\_TYPE (REGIONS=1, OWNER=2, BASIC/CLOCK=3). Resolves the tagged response body. Prefer the typed wrappers below where they exist. #### Parameters [Section titled “Parameters”](#parameters-31) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | | `anonType` | `number` | #### Returns [Section titled “Returns”](#returns-49) `Promise`<`Buffer`<`ArrayBufferLike`>> *** ### sendBinaryRequest() [Section titled “sendBinaryRequest()”](#sendbinaryrequest)
```ts
sendBinaryRequest(
contactKey,
reqData,
opts?): Promise>;
```
Defined in: [src/session/session.ts:1561](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1561) Send a generic binary request to a contact and resolve the raw response body. `reqData` is \[REQ\_TYPE byte, …params]. The ACL/neighbours/owner/ avg-min-max helpers are thin wrappers over this. #### Parameters [Section titled “Parameters”](#parameters-32) | Parameter | Type | | ----------------- | --------------------------- | | `contactKey` | `string` | | `reqData` | `Buffer` | | `opts` | { `timeoutMs?`: `number`; } | | `opts.timeoutMs?` | `number` | #### Returns [Section titled “Returns”](#returns-50) `Promise`<`Buffer`<`ArrayBufferLike`>> *** ### sendChannelData() [Section titled “sendChannelData()”](#sendchanneldata)
```ts
sendChannelData(opts): Promise;
```
Defined in: [src/session/session.ts:1468](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1468) Broadcast a group-channel datagram (CMD\_SEND\_CHANNEL\_DATA, flood). #### Parameters [Section titled “Parameters”](#parameters-33) | Parameter | Type | | ----------------- | ---------------------------------------------------------------------- | | `opts` | { `channelIdx`: `number`; `dataType`: `number`; `payload`: `Buffer`; } | | `opts.channelIdx` | `number` | | `opts.dataType` | `number` | | `opts.payload` | `Buffer` | #### Returns [Section titled “Returns”](#returns-51) `Promise`<`void`> *** ### sendChannelText() [Section titled “sendChannelText()”](#sendchanneltext)
```ts
sendChannelText(channelKey, text): Promise<{
channelHash?: number;
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:793](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L793) Returns ok on transport-level write success. When ok, `channelHash` is the byte the firmware tags GRP\_TXT packets with on this channel — the caller uses it to register a pending-send entry so subsequent PUSH\_CODE\_LOG\_RX\_DATA observations matching that byte can be attributed back to the outgoing message (repeater relays we hear over the air). #### Parameters [Section titled “Parameters”](#parameters-34) | Parameter | Type | | ------------ | -------- | | `channelKey` | `string` | | `text` | `string` | #### Returns [Section titled “Returns”](#returns-52) `Promise`<{ `channelHash?`: `number`; `error?`: `string`; `ok`: `boolean`; }> *** ### sendControlData() [Section titled “sendControlData()”](#sendcontroldata)
```ts
sendControlData(payload): Promise;
```
Defined in: [src/session/session.ts:1463](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1463) Send a zero-hop control datagram (CMD\_SEND\_CONTROL\_DATA). #### Parameters [Section titled “Parameters”](#parameters-35) | Parameter | Type | | --------- | -------- | | `payload` | `Buffer` | #### Returns [Section titled “Returns”](#returns-53) `Promise`<`void`> *** ### sendDmText() [Section titled “sendDmText()”](#senddmtext)
```ts
sendDmText(
contactKey,
text,
messageId,
opts?): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:800](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L800) Send a DM to a contact. Returns ok on transport-level write success; the message state machine continues asynchronously: RESP\_SENT flips ‘sending’ → ‘sent’, PUSH\_SEND\_CONFIRMED flips ‘sent’ → ‘ack’. #### Parameters [Section titled “Parameters”](#parameters-36) | Parameter | Type | | --------------- | ------------------------- | | `contactKey` | `string` | | `text` | `string` | | `messageId` | `string` | | `opts` | { `attempt?`: `number`; } | | `opts.attempt?` | `number` | #### Returns [Section titled “Returns”](#returns-54) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### sendDmTextWithRetry() [Section titled “sendDmTextWithRetry()”](#senddmtextwithretry)
```ts
sendDmTextWithRetry(
contactKey,
text,
messageId): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:811](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L811) Send a DM with retry + flood fallback, mirroring the official client’s behavior. #### Parameters [Section titled “Parameters”](#parameters-37) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | | `text` | `string` | | `messageId` | `string` | #### Returns [Section titled “Returns”](#returns-55) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### sendPathDiscoveryReq() [Section titled “sendPathDiscoveryReq()”](#sendpathdiscoveryreq)
```ts
sendPathDiscoveryReq(contactKey): Promise;
```
Defined in: [src/session/session.ts:1446](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1446) Discover the round-trip mesh path to a contact (floods a request, then awaits PUSH\_PATH\_DISCOVERY\_RESPONSE). Rejects on dispatch error/timeout. #### Parameters [Section titled “Parameters”](#parameters-38) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-56) `Promise`<[`DiscoveredPath`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/discoveredpath/)> *** ### sendRawData() [Section titled “sendRawData()”](#sendrawdata)
```ts
sendRawData(opts): Promise;
```
Defined in: [src/session/session.ts:1458](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1458) Send raw bytes DIRECT along a known path (CMD\_SEND\_RAW\_DATA). #### Parameters [Section titled “Parameters”](#parameters-39) | Parameter | Type | | -------------- | --------------------------------------------- | | `opts` | { `pathHex`: `string`; `payload`: `Buffer`; } | | `opts.pathHex` | `string` | | `opts.payload` | `Buffer` | #### Returns [Section titled “Returns”](#returns-57) `Promise`<`void`> *** ### sendRawPacket() [Section titled “sendRawPacket()”](#sendrawpacket)
```ts
sendRawPacket(opts): Promise;
```
Defined in: [src/session/session.ts:1473](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1473) Transmit a fully-formed mesh packet (CMD\_SEND\_RAW\_PACKET). #### Parameters [Section titled “Parameters”](#parameters-40) | Parameter | Type | | ---------------- | ------------------------------------------------ | | `opts` | { `packetHex`: `string`; `priority`: `number`; } | | `opts.packetHex` | `string` | | `opts.priority` | `number` | #### Returns [Section titled “Returns”](#returns-58) `Promise`<`void`> *** ### sendSelfAdvert() [Section titled “sendSelfAdvert()”](#sendselfadvert)
```ts
sendSelfAdvert(flood?): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:1334](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1334) Send a self-advert. `flood=true` propagates many hops (so DM-able by distant peers); `flood=false` is zero-hop (cheap, only direct neighbors). #### Parameters [Section titled “Parameters”](#parameters-41) | Parameter | Type | Default value | | --------- | --------- | ------------- | | `flood` | `boolean` | `true` | #### Returns [Section titled “Returns”](#returns-59) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### sendStatusReq() [Section titled “sendStatusReq()”](#sendstatusreq)
```ts
sendStatusReq(contactKey): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:1499](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1499) Request a status snapshot from a repeater/room/contact. The actual snapshot arrives later via PUSH\_STATUS\_RESPONSE → emit.repeaterStatus(). #### Parameters [Section titled “Parameters”](#parameters-42) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-60) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### sendTelemetryReq() [Section titled “sendTelemetryReq()”](#sendtelemetryreq)
```ts
sendTelemetryReq(contactKey): Promise<{
error?: string;
ok: boolean;
}>;
```
Defined in: [src/session/session.ts:1504](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1504) Request a CayenneLPP telemetry blob from a contact. See sendStatusReq. #### Parameters [Section titled “Parameters”](#parameters-43) | Parameter | Type | | ------------ | -------- | | `contactKey` | `string` | #### Returns [Section titled “Returns”](#returns-61) `Promise`<{ `error?`: `string`; `ok`: `boolean`; }> *** ### setAdvertLatLon() [Section titled “setAdvertLatLon()”](#setadvertlatlon)
```ts
setAdvertLatLon(
lat,
lon,
alt?): Promise;
```
Defined in: [src/session/session.ts:1193](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1193) Push device GPS coords used in self-adverts. #### Parameters [Section titled “Parameters”](#parameters-44) | Parameter | Type | | --------- | -------- | | `lat` | `number` | | `lon` | `number` | | `alt?` | `number` | #### Returns [Section titled “Returns”](#returns-62) `Promise`<`boolean`> *** ### setAdvertName() [Section titled “setAdvertName()”](#setadvertname)
```ts
setAdvertName(name): Promise;
```
Defined in: [src/session/session.ts:1168](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1168) Push the device’s advertised display name. #### Parameters [Section titled “Parameters”](#parameters-45) | Parameter | Type | | --------- | -------- | | `name` | `string` | #### Returns [Section titled “Returns”](#returns-63) `Promise`<`boolean`> *** ### setAutoAddConfig() [Section titled “setAutoAddConfig()”](#setautoaddconfig)
```ts
setAutoAddConfig(flags): Promise;
```
Defined in: [src/session/session.ts:1247](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1247) Push the auto-add flags byte. App-side `mode`/`maxHops`/`pullToRefresh`/ `showPublicKeys` are stored locally and don’t go on the wire. #### Parameters [Section titled “Parameters”](#parameters-46) | Parameter | Type | | --------- | --------------------------------------------------------------------------------------------------- | | `flags` | [`AutoAddFlagsInput`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/autoaddflagsinput/) | #### Returns [Section titled “Returns”](#returns-64) `Promise`<`boolean`> *** ### setChannel() [Section titled “setChannel()”](#setchannel)
```ts
setChannel(
idx,
name,
secretHex): Promise;
```
Defined in: [src/session/session.ts:1077](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1077) Write a channel slot (add / edit / delete). Delete = empty name + zero key, which our enumerator filters as `empty`. Returns true if the radio acked, false on RESP\_ERR / timeout / disconnect. #### Parameters [Section titled “Parameters”](#parameters-47) | Parameter | Type | | ----------- | -------- | | `idx` | `number` | | `name` | `string` | | `secretHex` | `string` | #### Returns [Section titled “Returns”](#returns-65) `Promise`<`boolean`> *** ### setContactFavourite() [Section titled “setContactFavourite()”](#setcontactfavourite)
```ts
setContactFavourite(publicKeyHex, favourite): Promise;
```
Defined in: [src/session/session.ts:948](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L948) Toggle the favourite flag (contact flags bit 0). For on-radio contacts, round-trips CMD\_ADD\_UPDATE\_CONTACT so the firmware persists the flag (protects from overwrite-oldest). Discovered-only contacts update locally. #### Parameters [Section titled “Parameters”](#parameters-48) | Parameter | Type | | -------------- | --------- | | `publicKeyHex` | `string` | | `favourite` | `boolean` | #### Returns [Section titled “Returns”](#returns-66) `Promise`<`void`> *** ### setContactPath() [Section titled “setContactPath()”](#setcontactpath)
```ts
setContactPath(
contactKey,
outPathHex,
opts?): Promise;
```
Defined in: [src/session/session.ts:821](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L821) Write a contact’s out\_path back to the radio so the firmware uses it for future source-routed sends. Round-trips the contact’s current type/flags/ name (firmware *replaces* on update, not merges). On RESP\_OK, updates local state with the new path + `pathManual`. #### Parameters [Section titled “Parameters”](#parameters-49) | Parameter | Type | | -------------------- | ---------------------------------------------------- | | `contactKey` | `string` | | `outPathHex` | `string` | | `opts` | { `manual`: `boolean`; `preferDirect?`: `boolean`; } | | `opts.manual` | `boolean` | | `opts.preferDirect?` | `boolean` | #### Returns [Section titled “Returns”](#returns-67) `Promise`<`void`> *** ### setContactPreferDirect() [Section titled “setContactPreferDirect()”](#setcontactpreferdirect)
```ts
setContactPreferDirect(contactKey, preferDirect): void;
```
Defined in: [src/session/session.ts:980](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L980) Toggle the per-contact “always use direct (companion-side) login” flag. Local-only; no firmware write. #### Parameters [Section titled “Parameters”](#parameters-50) | Parameter | Type | | -------------- | --------- | | `contactKey` | `string` | | `preferDirect` | `boolean` | #### Returns [Section titled “Returns”](#returns-68) `void` *** ### setDefaultFloodScope() [Section titled “setDefaultFloodScope()”](#setdefaultfloodscope)
```ts
setDefaultFloodScope(name, keyHex): Promise;
```
Defined in: [src/session/session.ts:1386](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1386) Persist the default flood scope (CMD\_SET\_DEFAULT\_FLOOD\_SCOPE). #### Parameters [Section titled “Parameters”](#parameters-51) | Parameter | Type | | --------- | -------- | | `name` | `string` | | `keyHex` | `string` | #### Returns [Section titled “Returns”](#returns-69) `Promise`<`void`> *** ### setDevicePin() [Section titled “setDevicePin()”](#setdevicepin)
```ts
setDevicePin(pin): Promise;
```
Defined in: [src/session/session.ts:1425](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1425) Set the BLE pairing PIN (0 disables it; otherwise a 6-digit number). #### Parameters [Section titled “Parameters”](#parameters-52) | Parameter | Type | | --------- | -------- | | `pin` | `number` | #### Returns [Section titled “Returns”](#returns-70) `Promise`<`void`> *** ### setDeviceTime() [Section titled “setDeviceTime()”](#setdevicetime)
```ts
setDeviceTime(epochSecs): Promise;
```
Defined in: [src/session/session.ts:1352](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1352) Set the radio’s RTC clock (unix seconds). Rejects ProtocolError if the radio returns RESP\_ERR (e.g. a clock earlier than its own → ILLEGAL\_ARG). #### Parameters [Section titled “Parameters”](#parameters-53) | Parameter | Type | | ----------- | -------- | | `epochSecs` | `number` | #### Returns [Section titled “Returns”](#returns-71) `Promise`<`void`> *** ### setFloodScopeKey() [Section titled “setFloodScopeKey()”](#setfloodscopekey)
```ts
setFloodScopeKey(input): Promise;
```
Defined in: [src/session/session.ts:1374](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1374) Override the send-scope key for outgoing flood packets (set / clear / unscoped). #### Parameters [Section titled “Parameters”](#parameters-54) | Parameter | Type | | --------- | ------------------------------------------------------------------------------------------------- | | `input` | [`FloodScopeInput`](/meshcore-ts/api/andyshinn/namespaces/features/type-aliases/floodscopeinput/) | #### Returns [Section titled “Returns”](#returns-72) `Promise`<`void`> *** ### setFloodScopeRegion() [Section titled “setFloodScopeRegion()”](#setfloodscoperegion)
```ts
setFloodScopeRegion(region): Promise;
```
Defined in: [src/session/session.ts:1381](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1381) Derive the 16-byte scope key for a public hashtag region (SHA-256(“#name”)\[:16]) and set it as the send-scope override. Equivalent to `setFloodScopeKey({ keyHex: deriveFloodScopeKey(region) })`. #### Parameters [Section titled “Parameters”](#parameters-55) | Parameter | Type | | --------- | -------- | | `region` | `string` | #### Returns [Section titled “Returns”](#returns-73) `Promise`<`void`> *** ### setGpsConfig() [Section titled “setGpsConfig()”](#setgpsconfig)
```ts
setGpsConfig(cfg): Promise;
```
Defined in: [src/session/session.ts:1261](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1261) Toggle the GPS module / change interval via custom-var KV. The firmware ignores intervals outside \[60, 86399]; we clamp client-side too. #### Parameters [Section titled “Parameters”](#parameters-56) | Parameter | Type | | ----------------- | -------------------------------------------------- | | `cfg` | { `enabled`: `boolean`; `intervalSec`: `number`; } | | `cfg.enabled` | `boolean` | | `cfg.intervalSec` | `number` | #### Returns [Section titled “Returns”](#returns-74) `Promise`<`boolean`> *** ### setOtherParams() [Section titled “setOtherParams()”](#setotherparams)
```ts
setOtherParams(policy, sharePositionInAdvert): Promise;
```
Defined in: [src/session/session.ts:1214](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1214) Push telemetry policy + multi-acks + advert-location-policy as one frame. The advert-location-policy flag mirrors `DeviceIdentity.sharePositionInAdvert` and `TelemetryPolicy` fields drive the rest. #### Parameters [Section titled “Parameters”](#parameters-57) | Parameter | Type | | ----------------------- | --------------------------------------------------------------------------------------------------------- | | `policy` | { `base`: `0` \| `1` \| `2`; `env`: `0` \| `1` \| `2`; `loc`: `0` \| `1` \| `2`; `multiAcks`: `number`; } | | `policy.base` | `0` \| `1` \| `2` | | `policy.env` | `0` \| `1` \| `2` | | `policy.loc` | `0` \| `1` \| `2` | | `policy.multiAcks` | `number` | | `sharePositionInAdvert` | `boolean` | #### Returns [Section titled “Returns”](#returns-75) `Promise`<`boolean`> *** ### setPathHashMode() [Section titled “setPathHashMode()”](#setpathhashmode)
```ts
setPathHashMode(size): Promise;
```
Defined in: [src/session/session.ts:990](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L990) Set the radio’s global path-hash mode (bytes per hop). Persists on the radio and updates local RadioSettings on RESP\_OK. #### Parameters [Section titled “Parameters”](#parameters-58) | Parameter | Type | | --------- | ----------------- | | `size` | `1` \| `2` \| `3` | #### Returns [Section titled “Returns”](#returns-76) `Promise`<`void`> *** ### setRadioParams() [Section titled “setRadioParams()”](#setradioparams)
```ts
setRadioParams(opts): Promise;
```
Defined in: [src/session/session.ts:1113](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1113) Push LoRa modulation params (freq/bw/sf/cr) and TX power to the radio. Sent as two separate frames since the firmware splits them. Includes the trailing `clientRepeat` byte only when the connected firmware supports it (ver\_code ≥ 9 — surfaced via DeviceCapabilities.repeatMode). #### Parameters [Section titled “Parameters”](#parameters-59) | Parameter | Type | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `opts` | { `bandwidthHz`: `number`; `codingRate`: `number`; `frequencyHz`: `number`; `repeatMode`: `boolean`; `spreadingFactor`: `number`; `txPowerDbm`: `number`; } | | `opts.bandwidthHz` | `number` | | `opts.codingRate` | `number` | | `opts.frequencyHz` | `number` | | `opts.repeatMode` | `boolean` | | `opts.spreadingFactor` | `number` | | `opts.txPowerDbm` | `number` | #### Returns [Section titled “Returns”](#returns-77) `Promise`<`boolean`> *** ### setTuningParams() [Section titled “setTuningParams()”](#settuningparams)
```ts
setTuningParams(params): Promise;
```
Defined in: [src/session/session.ts:1369](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1369) Write the radio airtime/backoff tuning params (CMD\_SET\_TUNING\_PARAMS). #### Parameters [Section titled “Parameters”](#parameters-60) | Parameter | Type | | --------- | ----------------------------------------------------------------------------------------- | | `params` | [`TuningParams`](/meshcore-ts/api/andyshinn/namespaces/features/interfaces/tuningparams/) | #### Returns [Section titled “Returns”](#returns-78) `Promise`<`void`> *** ### shareContact() [Section titled “shareContact()”](#sharecontact)
```ts
shareContact(destPublicKeyHex): Promise;
```
Defined in: [src/session/session.ts:1480](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1480) Re-broadcast a known contact’s advert zero-hop (CMD\_SHARE\_CONTACT). #### Parameters [Section titled “Parameters”](#parameters-61) | Parameter | Type | | ------------------ | -------- | | `destPublicKeyHex` | `string` | #### Returns [Section titled “Returns”](#returns-79) `Promise`<`void`> *** ### signData() [Section titled “signData()”](#signdata)
```ts
signData(data): Promise;
```
Defined in: [src/session/session.ts:1438](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1438) Sign arbitrary bytes with the device’s ed25519 identity. Drives the CMD\_SIGN\_START → CMD\_SIGN\_DATA× → CMD\_SIGN\_FINISH state machine and returns the 64-byte signature (hex). #### Parameters [Section titled “Parameters”](#parameters-62) | Parameter | Type | | --------- | -------- | | `data` | `Buffer` | #### Returns [Section titled “Returns”](#returns-80) `Promise`<`string`> *** ### start() [Section titled “start()”](#start)
```ts
start(): void;
```
Defined in: [src/session/session.ts:227](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L227) #### Returns [Section titled “Returns”](#returns-81) `void` *** ### stop() [Section titled “stop()”](#stop)
```ts
stop(): void;
```
Defined in: [src/session/session.ts:257](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L257) #### Returns [Section titled “Returns”](#returns-82) `void` *** ### syncDeviceTime() [Section titled “syncDeviceTime()”](#syncdevicetime)
```ts
syncDeviceTime(): Promise;
```
Defined in: [src/session/session.ts:1357](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L1357) Push the host’s current time to the radio. #### Returns [Section titled “Returns”](#returns-83) `Promise`<`void`>
# MeshCoreSessionOptions
Defined in: [src/session/session.ts:119](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L119) ## Properties [Section titled “Properties”](#properties) ### appName? [Section titled “appName?”](#appname)
```ts
optional appName?: string;
```
Defined in: [src/session/session.ts:123](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L123) APP\_START app name. Default ‘meshcore-ts’. *** ### appVersion? [Section titled “appVersion?”](#appversion)
```ts
optional appVersion?: number;
```
Defined in: [src/session/session.ts:125](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L125) APP\_START version byte. Default 1. *** ### logger? [Section titled “logger?”](#logger)
```ts
optional logger?: Logger;
```
Defined in: [src/session/session.ts:121](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L121) *** ### transport [Section titled “transport”](#transport)
```ts
transport: Transport;
```
Defined in: [src/session/session.ts:120](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/session/session.ts#L120)
# @andyshinn/meshcore-ts
## Namespaces [Section titled “Namespaces”](#namespaces) * [Errors](/meshcore-ts/api/andyshinn/namespaces/errors/readme/) * [Features](/meshcore-ts/api/andyshinn/namespaces/features/readme/) * [Models](/meshcore-ts/api/andyshinn/namespaces/models/readme/) * [Ports](/meshcore-ts/api/andyshinn/namespaces/ports/readme/) * [Protocol](/meshcore-ts/api/andyshinn/namespaces/protocol/readme/) * [Transports](/meshcore-ts/api/andyshinn/namespaces/transports/readme/) ## Classes [Section titled “Classes”](#classes) * [MeshCoreSession](/meshcore-ts/api/classes/meshcoresession/) ## Interfaces [Section titled “Interfaces”](#interfaces) * [MeshCoreSessionOptions](/meshcore-ts/api/interfaces/meshcoresessionoptions/) ## Variables [Section titled “Variables”](#variables) * [VERSION](/meshcore-ts/api/variables/version/)
# VERSION
```ts
const VERSION: string = version;
```
Defined in: [src/index.ts:5](https://github.com/andyshinn/meshcore-ts/blob/36e73e9a5a3e10ac134aeabbe78a4060213d671b/src/index.ts#L5)
# Changelog
> Notable changes to meshcore-ts, newest first.
Notable changes to `meshcore-ts`, newest first. Versions follow [semantic versioning](https://semver.org/); pre-`1.0` minor bumps may still carry behaviour changes. ## 0.4.0 [Section titled “0.4.0”](#040) *Guest logins, and repeater logins now route over the mesh.* ### Added [Section titled “Added”](#added) * **Guest login.** `session.repeaterLogin(contactKey, '')` now performs a guest login with an empty password. This is the bootstrap a public repeater expects before it will answer login-gated requests: the flooded login reply installs the contact’s `out_path` and adds you to the repeater’s ACL. ### Changed [Section titled “Changed”](#changed) * **Repeater logins always dispatch via `CMD_SEND_LOGIN` (`0x1a`).** The radio routes the frame for us — **direct** when the contact’s `out_path` is known, **flood** when it isn’t — so the one command covers Direct / Flood / N-hop. Previously only `preferDirect` contacts used `CMD_SEND_LOGIN`; mesh logins went out as an anonymous request (`CMD_SEND_ANON_REQ`, `0x39`) that rejected empty passwords, so a guest login was impossible. * `repeaterLogin`’s signature and return shape are unchanged (`repeaterLogin(contactKey, password) → LoginSuccess & { mode, effective }`); `mode`/`effective` remain UI labels derived from the contact’s path state. ### Removed [Section titled “Removed”](#removed) * **`Protocol.buildAnonLogin`.** It only existed to wrap a password as anon-request data for the old mesh-login path, and it could not build a valid guest frame (an empty anon request is rejected by the firmware). Login framing now goes through `Protocol.buildSendLogin`, which accepts an empty password. ## 0.3.2 [Section titled “0.3.2”](#032) *Developed after 0.3.1 as the `0.3.2-dev` series and shipped as part of 0.4.0.* ### Fixed [Section titled “Fixed”](#fixed) * **Public owner-info and telemetry now work without a login.** These requests previously targeted the wrong companion command families, so a repeater serving them publicly never answered (while `meshcore_py` did). * `session.repeaterRequestOwnerInfo(contactKey)` now uses the public anon OWNER request and parses `[now][name\nowner]`; it returns `OwnerInfo | null` (`firmwareVersion` is empty — the anon response carries no version). * `session.sendTelemetryReq(contactKey)` now uses the binary TELEMETRY request and decodes the tagged CayenneLPP payload, re-emitting the same `repeaterTelemetry` snapshot. The legacy `PUSH_TELEMETRY_RESPONSE` handler is retained for self/legacy devices. * **Multi-byte path-hash sizes are handled correctly.** The `out_path` length byte is now packed/parsed as MeshCore’s `((hashSize - 1) << 6) | hopCount`, and routes are reversed by hop, so hash sizes larger than one byte are no longer mangled (previously the code assumed 1-byte hashes). ### Added [Section titled “Added”](#added-1) * Low-level public anon request access: `session.sendAnonReq(contactKey, anonType)` (`anonType` from `Protocol.ANON_REQ_TYPE`). * Typed public anon wrappers: `session.repeaterRequestRegions(contactKey)` (region-name listing) and `session.repeaterRequestClock(contactKey)` (the repeater’s RTC clock, unix seconds).
# Decoding on-air packets
> Receive raw LoRa mesh packets via the rawPacket event and structurally decode them with decodeOnAirPacket.
Beyond the parsed companion-protocol events, the session can hand you the **raw on-air bytes** it receives over the air, and a standalone decoder turns those bytes into a structured, inspectable shape — the basis for a packet inspector. ## The `rawPacket` event [Section titled “The rawPacket event”](#the-rawpacket-event) When the radio reports a received LoRa packet (`PUSH_RAW_DATA` / `PUSH_LOG_RX_DATA`), the session emits `rawPacket`:
```ts
session.events.on('rawPacket', (pkt) => {
// pkt: { hex: string; source: 'raw' | 'log_rx'; snr: number; rssi: number }
console.log(pkt.source, pkt.snr, pkt.rssi, pkt.hex);
});
```
* `hex` — the inner on-air mesh-packet bytes (the companion framing and the SNR/RSSI prefix are already stripped). * `source` — `'log_rx'` for `PUSH_LOG_RX_DATA` (0x88) or `'raw'` for `PUSH_RAW_DATA` (0x84). * `snr` / `rssi` — link metrics for that reception. ## `decodeOnAirPacket(hex)` [Section titled “decodeOnAirPacket(hex)”](#decodeonairpackethex) `decodeOnAirPacket` structurally decodes those bytes into a tagged union. It performs **no decryption** (cipher bodies are reported only as a length) and **never throws** — unparseable or unsupported input yields the `raw` fallback variant.
```ts
import { Protocol } from '@andyshinn/meshcore-ts';
session.events.on('rawPacket', (pkt) => {
const packet = Protocol.decodeOnAirPacket(pkt.hex); // also accepts a Uint8Array
console.log(packet.payloadTypeName); // e.g. 'GRP_TXT'
switch (packet.payload.kind) {
case Protocol.PayloadKind.ADVERT:
console.log(packet.payload.advert.appData.name);
break;
case Protocol.PayloadKind.GRP_TXT:
console.log(packet.payload.channelHash, packet.payload.cipherLen);
break;
case Protocol.PayloadKind.TRACE:
console.log(packet.payload.tag, packet.payload.hopCount, packet.payload.snr);
break;
// …txtMsg, req, response, anonReq, ack, path, control*, raw
}
});
```
> `Protocol.PayloadKind` is optional sugar — the raw discriminant strings (`case 'grpTxt':`) work equally well in the switch. `decodeOnAirPacket` returns `{ header, payloadTypeName, payload }`: * `header` — the mesh-packet header (route type, payload type/version, path), or `null` if the bytes don’t parse as a mesh packet. * `payloadTypeName` — the on-air payload type name for display (e.g. `TXT_MSG`, `TRACE`). * `payload` — a discriminated union on `payload.kind`, covering `advert`, `txtMsg`, `grpTxt`, `req`, `response`, `anonReq`, `ack`, `path`, `trace`, `controlDiscoverReq`, `controlDiscoverResp`, `controlOther`, and a `raw` fallback. See `OnAirPacket` and `OnAirPayload` in the [API reference](../../api/readme/) for every field of every variant. ## A note on the two sources [Section titled “A note on the two sources”](#a-note-on-the-two-sources) Only `log_rx` (0x88) packets follow the on-air wire format byte-for-byte. `raw` (0x84) packets carry a firmware reserved-byte sentinel where the path length would be, so `decodeOnAirPacket` will usually return the `raw` fallback for them — the `source` field lets you caveat the display accordingly. ## No hardware needed [Section titled “No hardware needed”](#no-hardware-needed) `decodeOnAirPacket` is a pure function: you can decode a pasted or captured hex string with no live session at all. See `examples/decode-on-air-packet.ts` for a runnable, hardware-free demonstration across several payload types.
# Events & state
> Subscribe to the typed event emitter and read the in-memory state model.
You don’t inject events or state — the session creates them and exposes them: * `session.events` — a typed emitter. Subscribe with `session.events.on('contacts', cb)`. * `session.state` — the in-memory model. Read with `session.state.getContacts()`, `getChannels()`, `getOwner()`, `getMessagesForKey(key)`, and friends. ## Subscribe before connecting [Section titled “Subscribe before connecting”](#subscribe-before-connecting) Subscribe **before** driving the transport to `connected` so you observe the full handshake and initial sync:
```ts
import { Ports } from '@andyshinn/meshcore-ts';
session.events.on('owner', (owner) => console.log('this device:', owner?.name));
session.events.on('contacts', (contacts) => persistContacts(contacts));
session.events.on('syncProgress', (p) => console.log(p.phase, p.contacts));
// Named constants are available for every event key — both forms are equivalent:
session.events.on(Ports.EventName.RAW_PACKET, (pkt) => { /* … */ });
// equivalent to: session.events.on('rawPacket', (pkt) => { … })
session.start();
transport.setState('connected');
```
## The events [Section titled “The events”](#the-events) `transportState`, `rawPacket`, `channels`, `channelPresence`, `syncProgress`, `contacts`, `discovered`, `contactEvicted`, `contactDiscovered`, `contactsFull`, `contactObserved`, `messages`, `messageUpserted`, `messageState`, `messagePathHeard`, `owner`, `radioSettings`, `repeaterStatus`, `repeaterTelemetry`, `pathLearned`, `deviceIdentity`, `autoAddConfig`, `telemetryPolicy`, `gpsConfig`, `deviceInfo`, `deviceCapabilities`. All payloads are exported types — see `Ports.EventMap` in the [API reference](../../api/readme/). There is intentionally no generic `error` event. Specific recoverable conditions get their own dedicated event instead — for example `contactsFull` fires when the radio’s contact store is full and a new advert could not be auto-added. Adapters can bridge such events onto their own error/toast channel. `rawPacket` carries the raw on-air bytes of each received LoRa packet; pair it with `decodeOnAirPacket` to structurally decode them — see [Decoding on-air packets](../decoding-packets/). ## What the session can do [Section titled “What the session can do”](#what-the-session-can-do) Beyond messaging, the session covers contacts & paths (`getContactByKey`, `setContactPath`, `addContactToRadio`, `setContactFavourite`, …), channels (`setChannel`, `pickFreeSlot`, `deriveSecret`, …), radio/device settings (`setRadioParams`, `setAdvertName`, `setGpsConfig`, `reboot`, …), time (`getDeviceTime` / `setDeviceTime` / `syncDeviceTime`), device admin & signing (`exportPrivateKey`, `setDevicePin`, `factoryReset`, `signData`), path diagnostics & raw frames (`sendPathDiscoveryReq`, `sendRawData`, …), and repeater administration (`repeaterLogin`, `repeaterSendCli`, `repeaterTracePath`, `sendStatusReq`, `sendTelemetryReq`, …). See the [API reference](../../api/readme/) for the complete, typed surface.
# Getting started
> Install meshcore-ts, construct a session, and send your first message.
`meshcore-ts` speaks the MeshCore **companion-radio** wire protocol — the framing a phone or desktop app uses to talk to a MeshCore device over BLE or serial. It owns the protocol logic, frame parsing, the connect handshake, the DM/channel messaging state machines, and repeater administration, and keeps an in-memory model of contacts, channels, messages, and device state. You bring a [Transport](../transports/) (the bytes in and out of your radio); the library does everything above that line and emits typed events. ## Install [Section titled “Install”](#install)
```sh
pnpm add @andyshinn/meshcore-ts
```
> **Node-only.** Uses `node:buffer` and `node:crypto`. Not a browser build. ## Construct a session and send a message [Section titled “Construct a session and send a message”](#construct-a-session-and-send-a-message) The exported `Transports.Loopback` lets you run the whole flow without hardware — swap it for your BLE/serial adapter later.
```ts
import { MeshCoreSession, Transports } from '@andyshinn/meshcore-ts';
const transport = new Transports.Loopback(); // swap for your BLE/serial adapter
const session = new MeshCoreSession({ transport /*, logger, appName, appVersion */ });
// Subscribe BEFORE connecting so you don't miss the handshake.
session.events.on('owner', (owner) => console.log('this device:', owner?.name));
session.events.on('contacts', (contacts) => persistContacts(contacts));
session.events.on('channels', (channels) => persistChannels(channels));
session.events.on('messages', (key, messages) => persistMessages(key, messages));
session.events.on('messageState', (id, state) => updateBubble(id, state));
session.events.on('syncProgress', (p) => console.log(p.phase, p.contacts));
session.start();
// When your transport connects, the session runs the handshake automatically:
// DEVICE_QUERY → APP_START → GET_CONTACTS → channel enumeration → drain.
transport.setState('connected');
// Send a direct message (you supply the message id; track state via events):
await session.sendDmText('c:', 'hello', 'msg-1');
```
## What happens on connect [Section titled “What happens on connect”](#what-happens-on-connect) When your transport reports `connected`, the session runs the connect handshake for you and emits events as state arrives. Subscribe before calling `transport.setState('connected')` so you observe the full sync. Next steps: * [Implement a Transport](../transports/) for your radio. * [Send DMs and channel messages](../messaging/) and track delivery state. * [Browse the events and state model](../events-and-state/). * [Full API reference](../../api/readme/).
# Messaging
> Send direct and channel messages and track delivery state via events.
The session exposes high-level send methods and surfaces delivery progress through the `messageState` event. You supply the message id; the session tracks its lifecycle. ## Direct messages [Section titled “Direct messages”](#direct-messages)
```ts
// You supply the message id and track state via events:
await session.sendDmText('c:', 'hello', 'msg-1');
```
The message moves through states surfaced via the `messageState` event:
```ts
session.events.on('messageState', (id, state) => updateBubble(id, state));
// 'sending' → 'sent' (RESP_SENT) → 'ack' (PUSH_SEND_CONFIRMED)
```
Need retries? Use `sendDmTextWithRetry`:
```ts
await session.sendDmTextWithRetry('c:', 'are you there?', 'msg-2');
```
## Channel messages [Section titled “Channel messages”](#channel-messages)
```ts
const { ok, channelHash } = await session.sendChannelText('ch:General', 'hi all');
```
Optionally attribute heard repeater relays back to your message — this emits the `messagePathHeard` event:
```ts
if (ok && channelHash != null) {
session.registerChannelSend({ messageId: 'msg-3', channelHash });
}
```
## Reading message history [Section titled “Reading message history”](#reading-message-history) Messages are kept in the in-memory state model, keyed by conversation:
```ts
const messages = session.state.getMessagesForKey('c:');
```
See [Events & state](../events-and-state/) for the full list of readers and events, and the [API reference](../../api/readme/) for exact signatures.
# Transports
> Implement the Transport port that moves companion frames to and from your radio.
A **Transport** is the only thing you must implement. It moves raw companion frames to and from your radio. The library handles companion-frame parsing (`0x84`/`0x88` mesh vs. companion classification) internally — your transport only deals in raw frame bytes. BLE/serial drivers, scanning, and native deps stay **your** responsibility; they are intentionally not in this library. ## The interface [Section titled “The interface”](#the-interface)
```ts
// The one contract you implement — exposed as `Ports.Transport`.
// (`TransportState` is `Models.TransportState`.)
interface Transport {
send(bytes: Uint8Array): Promise; // write one companion frame
onData(cb: (chunk: Uint8Array) => void): void; // one complete frame per call
onStateChange(cb: (s: TransportState) => void): void;
getState(): TransportState; // 'idle' | 'scanning' | 'connecting' | 'connected' | 'error'
}
```
> **Framing rule:** Each `onData` chunk must be **exactly one complete companion frame** — which is what a single BLE GATT notification delivers. ## Loopback (tests & examples) [Section titled “Loopback (tests & examples)”](#loopback-tests--examples) A ready-made `Transports.Loopback` is exported for tests and examples: * `send` captures outbound frames to `.sent` * `.receive(bytes)` / `.receiveHex(hex)` deliver inbound frames * `.setState(s)` drives connection state
```ts
import { Transports } from '@andyshinn/meshcore-ts';
const transport = new Transports.Loopback();
transport.setState('connected'); // drive the session's connect handshake
transport.receiveHex('84...'); // feed an inbound companion frame
console.log(transport.sent); // inspect what the session wrote
```
## Implementing a real transport (sketch) [Section titled “Implementing a real transport (sketch)”](#implementing-a-real-transport-sketch)
```ts
import { Models, Ports } from '@andyshinn/meshcore-ts';
class BleTransport implements Ports.Transport {
#dataCb?: (c: Uint8Array) => void;
#stateCb?: (s: Models.TransportState) => void;
#state: Models.TransportState = 'idle';
// your BLE library calls this once per GATT notification (= one frame):
#onNotification = (buf: Uint8Array) => this.#dataCb?.(buf);
async send(bytes: Uint8Array) { await this.#char.writeValue(bytes); }
onData(cb: (c: Uint8Array) => void) { this.#dataCb = cb; }
onStateChange(cb: (s: Models.TransportState) => void) { this.#stateCb = cb; }
getState() { return this.#state; }
// call #setState('connected') from your connect flow:
#setState(s: Models.TransportState) { this.#state = s; this.#stateCb?.(s); }
}
```
## Logger (optional) [Section titled “Logger (optional)”](#logger-optional)
```ts
interface Logger { trace; debug; info; warn; error: (...args: unknown[]) => void; }
```
Defaults to a no-op. Pass your own (`pino`, `console`, etc.) to see protocol-level logging:
```ts
const session = new MeshCoreSession({ transport, logger: console });
```
See the [events and state model](../events-and-state/) next, or the [full API reference](../../api/readme/). ## Built-in transport adapters [Section titled “Built-in transport adapters”](#built-in-transport-adapters) The `Transports` namespace ships ready-made adapters so you don’t have to write the boilerplate above for the two most common hardware transports. ## Serial (node-serialport) [Section titled “Serial (node-serialport)”](#serial-node-serialport)
```ts
import { SerialPort } from 'serialport';
import { MeshCoreSession, Transports } from '@andyshinn/meshcore-ts';
const port = new SerialPort({ path: '/dev/ttyUSB0', baudRate: 115200 });
const session = new MeshCoreSession({ transport: new Transports.Serial(port) });
session.start(); // Transports.Serial observes open/close/error; it does not open the port
```
`Transports.Serial` frames the MeshCore serial protocol for you. You own opening and closing the port. ## TCP (node:net) [Section titled “TCP (node:net)”](#tcp-nodenet) TCP devices speak the **same** companion wire framing as serial, and the only driver is the `node:net` builtin — so `Transports.Tcp` is **complete and batteries-included**: it owns its socket and its connect/close lifecycle (no bring-your-own driver, no third-party deps).
```ts
import { MeshCoreSession, Transports } from '@andyshinn/meshcore-ts';
const transport = new Transports.Tcp({ host: '192.168.1.50', port: 5000 });
await transport.connect(); // dials; resolves on connect, rejects on error/timeout
const session = new MeshCoreSession({ transport });
session.start();
// later:
await transport.close(); // destroys the socket; state returns to idle
```
Options: `{ host, port, connectTimeoutMs? = 10000, maxFrameBytes? = 256, createSocket? }`. `createSocket(host, port)` is a test seam (defaults to `net.createConnection`). `Transports.createTcp(opts)` is the factory form. State transitions are `idle → connecting → connected → idle` (on `close()`) or `error` (on connect failure/timeout). ## BLE (noble) [Section titled “BLE (noble)”](#ble-noble)
```ts
import noble from '@abandonware/noble';
import { MeshCoreSession, Transports } from '@andyshinn/meshcore-ts';
// After you have connected `peripheral` and discovered `rxChar`/`txChar`
// for Transports.NORDIC_UART.rxWrite / Transports.NORDIC_UART.txNotify:
const transport = Transports.createBle({
write: (bytes) => rxChar.writeAsync(Buffer.from(bytes), true),
subscribe: (onBytes) => {
txChar.on('data', (data: Buffer) => onBytes(new Uint8Array(data)));
txChar.subscribe(() => {});
},
watchState: (onState) => peripheral.on('disconnect', () => onState('idle')),
});
const session = new MeshCoreSession({ transport });
session.start();
```
## BLE (React Native — react-native-ble-plx) [Section titled “BLE (React Native — react-native-ble-plx)”](#ble-react-native--react-native-ble-plx) `react-native-ble-plx` deals in base64 strings, so decode/encode in your hooks:
```ts
import { Buffer } from 'buffer';
import { MeshCoreSession, Transports } from '@andyshinn/meshcore-ts';
const transport = Transports.createBle({
write: (bytes) =>
device.writeCharacteristicWithResponseForService(
service, rxUuid, Buffer.from(bytes).toString('base64'),
).then(() => {}),
subscribe: (onBytes) =>
device.monitorCharacteristicForService(service, txUuid, (_err, ch) => {
if (ch?.value) onBytes(new Uint8Array(Buffer.from(ch.value, 'base64')));
}),
watchState: (onState) =>
device.onDisconnected(() => onState('idle')),
});
const session = new MeshCoreSession({ transport });
session.start();
```