meshcore.js/src/constants.js

94 lines
2 KiB
JavaScript
Raw Normal View History

class Constants {
static SerialFrameTypes = {
Incoming: 0x3e, // ">"
Outgoing: 0x3c, // "<"
}
static Ble = {
ServiceUuid: "6E400001-B5A3-F393-E0A9-E50E24DCCA9E",
CharacteristicUuidRx: "6E400002-B5A3-F393-E0A9-E50E24DCCA9E",
CharacteristicUuidTx: "6E400003-B5A3-F393-E0A9-E50E24DCCA9E",
}
static CommandCodes = {
2025-02-11 17:52:21 +13:00
AppStart: 1,
SendTxtMsg: 2,
SendChannelTxtMsg: 3,
2025-02-11 17:52:21 +13:00
GetContacts: 4,
GetDeviceTime: 5,
SetDeviceTime: 6,
SendSelfAdvert: 7,
SetAdvertName: 8,
AddUpdateContact: 9,
SyncNextMessage: 10,
SetRadioParams: 11,
SetTxPower: 12,
2025-02-11 18:01:22 +13:00
ResetPath: 13,
2025-02-11 17:52:21 +13:00
SetAdvertLatLon: 14,
RemoveContact: 15,
2025-02-15 20:37:17 +13:00
ShareContact: 16,
2025-02-15 20:45:07 +13:00
ExportContact: 17,
2025-02-15 21:39:29 +13:00
ImportContact: 18,
2025-02-16 16:57:08 +13:00
Reboot: 19,
2025-02-16 17:00:00 +13:00
GetBatteryVoltage: 20,
2025-02-19 21:24:55 +13:00
SetTuningParams: 21, // todo
DeviceQuery: 22,
ExportPrivateKey: 23,
ImportPrivateKey: 24,
SendRawData: 25, // todo
SendLogin: 26, // todo
SendStatusReq: 27, // todo
}
static ResponseCodes = {
2025-02-11 17:52:21 +13:00
Ok: 0, // todo
Err: 1, // todo
ContactsStart: 2,
Contact: 3,
EndOfContacts: 4,
SelfInfo: 5,
Sent: 6,
ContactMsgRecv: 7,
ChannelMsgRecv: 8,
2025-02-11 17:52:21 +13:00
CurrTime: 9,
NoMoreMessages: 10,
2025-02-15 20:45:07 +13:00
ExportContact: 11,
2025-02-16 17:00:00 +13:00
BatteryVoltage: 12,
2025-02-19 21:24:55 +13:00
DeviceInfo: 13,
PrivateKey: 14,
Disabled: 15,
}
static PushCodes = {
2025-02-11 17:52:21 +13:00
Advert: 0x80,
PathUpdated: 0x81,
2025-02-11 17:52:21 +13:00
SendConfirmed: 0x82,
MsgWaiting: 0x83,
LoginSuccess: 0x85,
LoginFail: 0x86, // not usable yet
StatusResponse: 0x87,
2025-02-11 17:31:28 +13:00
}
static AdvType = {
None: 0,
Chat: 1,
Repeater: 2,
Room: 3,
}
static SelfAdvertTypes = {
ZeroHop: 0,
Flood: 1,
}
2025-02-11 17:31:28 +13:00
static TxtTypes = {
Plain: 0,
CliData: 1,
SignedPlain: 2,
}
}
export default Constants;