Updates
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package meshcore
|
||||
|
||||
import "fmt"
|
||||
|
||||
const (
|
||||
companionErrCodeUnsupported byte = 1 + iota
|
||||
companionErrCodeNotFound
|
||||
@@ -122,3 +124,56 @@ const (
|
||||
companionPushContactDeleted
|
||||
companionPushContactsFull
|
||||
)
|
||||
|
||||
var companionResponseNames = map[byte]string{
|
||||
companionResponseOK: "ok",
|
||||
companionResponseError: "error",
|
||||
companionResponseContactsStart: "contact start",
|
||||
companionResponseContact: "contact",
|
||||
companionResponseEndOfContacts: "end of contacts",
|
||||
companionResponseSelfInfo: "self info",
|
||||
companionResponseSent: "sent",
|
||||
companionResponseContactMessageReceived: "contact message received",
|
||||
companionResponseChannelMessageReceived: "channel message received",
|
||||
companionResponseCurrentTime: "current time",
|
||||
companionResponseNoMoreMessages: "no more messages",
|
||||
companionResponseExportContact: "export contact",
|
||||
companionResponseBatteryAndStorage: "battery and storage",
|
||||
companionResponseDeviceInfo: "device info",
|
||||
companionResponsePrivateKey: "private key",
|
||||
companionResponseDisabled: "disabled",
|
||||
companionResponseContactMessageReceivedV3: "contact message received V3",
|
||||
companionResponseChannelMessageReceivedV3: "channel message received V3",
|
||||
companionResponseChannelInfo: "channel info",
|
||||
companionResponseSignatureStart: "signature start",
|
||||
companionResponseSignature: "signature",
|
||||
companionResponseCustomVars: "custom vars",
|
||||
companionResponseAdvertPath: "advert path",
|
||||
companionResponseTuningParams: "tuning params",
|
||||
companionResponseStats: "stats",
|
||||
companionResponseAutoAddConfig: "auto add config",
|
||||
companionPushAdvert: "push advert",
|
||||
companionPushPathUpdated: "push path updated",
|
||||
companionPushSendConfirmed: "push send confirmed",
|
||||
companionPushMessageWaiting: "push message waiting",
|
||||
companionPushRawData: "push raw data",
|
||||
companionPushLoginSuccess: "push login success",
|
||||
companionPushLoginFailure: "push login failure",
|
||||
companionPushStatusResponse: "push status response",
|
||||
companionPushLogRXData: "push log rx data",
|
||||
companionPushTraceData: "push trace data",
|
||||
companionPushNewAdvert: "push new advert",
|
||||
companionPushTelemetryResponse: "push telemetry response",
|
||||
companionPushBinaryResponse: "push binary response",
|
||||
companionPushPathDiscoveryResponse: "push path discovery response",
|
||||
companionPushControlData: "push control data",
|
||||
companionPushContactDeleted: "push contact deleted",
|
||||
companionPushContactsFull: "push contacts full",
|
||||
}
|
||||
|
||||
func companionResponseName(response byte) string {
|
||||
if s, ok := companionResponseNames[response]; ok {
|
||||
return s
|
||||
}
|
||||
return fmt.Sprintf("unknown %02x", response)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user