#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "crossplatform.h"
Go to the source code of this file.
|
| enum | responseCodes {
JSPR_RC_NO_ERROR = 200
, JSPR_RC_UNSOLICITED_MESSAGE = 299
, JSPR_RC_API_VERSION_NOT_SELECTED = 400
, JSPR_RC_UNSUPPORTED_REQUEST_TYPE = 401
,
JSPR_RC_CONFIGURATION_ALREADY_SET = 402
, JSPR_RC_COMMAND_TOO_LONG = 403
, JSPR_RC_UNKNOWN_TARGET = 404
, JSPR_RC_COMMAND_MALFORMED = 405
,
JSPR_RC_OPERATION_NOT_ALLOWED = 406
, JSPR_RC_BAD_JSON = 407
, JSPR_RC_REQUEST_FAILED = 408
, JSPR_RC_UNAUTHORIZED = 409
,
JSPR_RC_SIM_NOT_CONFIGURED = 410
, JSPR_RC_WAKE_XCVR_IN_INVALID = 411
, JSPR_RC_INVALID_CHANNEL = 412
, JSPR_RC_INVALID_ACTION = 413
,
JSPR_RC_HARDWARE_NOT_CONFIGURED = 414
, JSPR_RC_INVALID_RADIO_PATH = 415
, JSPR_RC_CRASH_DUMP_NOT_AVAILABLE = 416
, JSPR_RC_FEATURE_NOT_SUPPORTED_BY_HARDWARE = 417
,
JSPR_RC_NOT_PROVISIONED = 418
, JSPR_RC_INVALID_TRANSMIT_POWER = 419
, JSPR_RC_INVALID_BURST_TYPE = 420
, JSPR_RC_SERIAL_PORT_ERROR = 500
} |
| |
| enum | jsprBootSource_t { JSPR_BOOT_SOURCE_UNKNOWN
, JSPR_BOOT_SOURCE_PRIMARY
, JSPR_BOOT_SOURCE_FALLBACK
} |
| |
| enum | availableSimInterfaces_t { SIM_NONE
, SIM_LOCAL
, SIM_REMOTE
, SIM_INTERNAL
} |
| |
| enum | availableOperationalStates_t {
INACTIVE
, ACTIVE
, CAL_TEST
, HW_SELF_TEST
,
RF_SCAN
, LOOPBACK
, FAULT
} |
| |
| enum | operationalStateReason_t {
NORMAL
, HARDWARE_SELF_TEST_FAILURE
, TEMPERATURE_FAULT
, RF_POWER_PROTECTION_FAULT
,
VAM_APP_FAILED_ACK_INTERFACE_TRANSITION_FLOWING
, INVALID_HARDWARE
, LOW_SUPPLY_VOLTAGE
, MFRTEST_USED_INCORRECTLY
} |
| |
| enum | messageOriginateResponses_t { MESSAGE_ACCEPTED
, SUBSCRIPTION_INVALID
, MESSAGE_DISCARDED_ON_OVERFLOW
} |
| |
| enum | jsprFinalMoStatus_t {
MO_ACK_RECEIVED_MOS
, MESSAGE_DISCARDED_ON_OVERFLOW_MOS
, MESSAGE_EXPIRED_MOS
, MESSAGE_TRANSFER_TIMEOUT_MOS
,
SEGMENT_NOT_SUPPLIED_MOS
, SEGMENT_INCORRECT_MOS
, NETWORK_ERROR_MOS
, MESSAGE_CANCELLED_PRE_TRANSIT_MOS
,
MESSAGE_CANCELLED_IN_TRANSIT_MOS
, SUBSCRIPTION_INVALID_MOS
, PROTOCOL_ERROR_MOS
, MESSAGE_DROPPED_LOCAL_CRC_ERROR_MOS
,
CRC_ERROR_IN_TRANSFER_MOS
, USER_SUPPLIED_CRC_ERROR_MOS
} |
| |
| enum | jsprFinalMtStatus_t { COMPLETE
, MESSAGE_TIMED_OUT
, MESSAGE_CANCELLED
, CRC_ERROR_IN_TRANSFER
} |
| |
| enum | jsprTopicPriority_t {
SAFETY_1
, SAFETY_2
, SAFETY_3
, HIGH_PRIORITY
,
MEDIUM_PRIORITY
, LOW_PRIORITY
} |
| |
|
| int | sendJspr (const char *buffer, size_t length) |
| |
| bool | receiveJspr (jsprResponse_t *response, const char *expectedTarget) |
| |
| bool | waitForJsprMessage (jsprResponse_t *response, const char *expectedTarget, const uint32_t expectedCode, const uint32_t timeoutSeconds) |
| |
| void | clearResponse (jsprResponse_t *response) |
| |
| bool | parseJsprBootInfo (const char *jsprString, jsprBootInfo_t *bootInfo) |
| |
| bool | parseJsprGetApiVersion (char *jsprString, jsprApiVersion_t *apiVersion) |
| |
| bool | parseJsprFirmwareInfo (const char *jsprString, jsprFirmwareInfo_t *firmwareInfo) |
| |
| bool | parseJsprGetSimInterface (char *jsprString, jsprSimInterface_t *simInterface) |
| |
| bool | parseJsprGetOperationalState (char *jsprString, jsprOperationalState_t *operationalState) |
| |
| bool | parseJsprPutMessageOriginate (char *jsprString, jsprMessageOriginate_t *messageOriginate) |
| |
| bool | parseJsprUnsMessageOriginateSegment (char *jsprString, jsprMessageOriginateSegment_t *messageOriginateSegment) |
| |
| bool | parseJsprUnsMessageTerminate (char *jsprString, jsprMessageTerminate_t *messageTerminate) |
| |
| bool | parseJsprUnsMessageTerminateSegment (char *jsprString, jsprMessageTerminateSegment_t *messageTerminateSegment) |
| |
| bool | parseJsprGetSignal (char *jsprString, jsprConstellationState_t *signal) |
| |
| bool | parseJsprUnsMessageOriginateStatus (char *jsprString, jsprMessageOriginateStatus_t *messageOriginateStatus) |
| |
| bool | parseJsprUnsMessageTerminateStatus (char *jsprString, jsprMessageTerminateStatus_t *messageTerminateStatus) |
| |
| bool | parseJsprGetMessageProvisioning (char *jsprString, jsprMessageProvisioning_t *messageProvisioning) |
| |
| bool | parseJsprGetHwInfo (char *jsprString, jsprHwInfo_t *hwInfo) |
| |
| bool | parseJsprGetSimStatus (char *jsprString, jsprSimStatus_t *simStatus) |
| |
◆ JSPR_BOOT_INFO_HASH_LEN
| #define JSPR_BOOT_INFO_HASH_LEN 65U |
◆ JSPR_BOOT_INFO_IMAGE_TYPE_LEN
| #define JSPR_BOOT_INFO_IMAGE_TYPE_LEN 11U |
◆ JSPR_HW_VERSION_MAX_LENGTH
| #define JSPR_HW_VERSION_MAX_LENGTH 7U |
◆ JSPR_ICCID_MAX_LENGTH
| #define JSPR_ICCID_MAX_LENGTH 20U |
◆ JSPR_IMEI_MAX_LENGTH
| #define JSPR_IMEI_MAX_LENGTH 16U |
◆ JSPR_MAX_JSON_LENGTH
| #define JSPR_MAX_JSON_LENGTH 3500U |
◆ JSPR_MAX_NUM_API_VERSIONS
| #define JSPR_MAX_NUM_API_VERSIONS 2U |
◆ JSPR_MAX_SEGMENT_LENGTH
| #define JSPR_MAX_SEGMENT_LENGTH 1447U |
◆ JSPR_MAX_TARGET_LENGTH [1/2]
| #define JSPR_MAX_TARGET_LENGTH 30U |
◆ JSPR_MAX_TARGET_LENGTH [2/2]
| #define JSPR_MAX_TARGET_LENGTH 30U |
◆ JSPR_MAX_TOPICS
| #define JSPR_MAX_TOPICS 20U |
◆ JSPR_MIN_RESPONSE
| #define JSPR_MIN_RESPONSE 9U |
◆ JSPR_RESULT_CODE_LENGTH
| #define JSPR_RESULT_CODE_LENGTH 3U |
◆ JSPR_SERIAL_NUMBER_MAX_LENGTH
| #define JSPR_SERIAL_NUMBER_MAX_LENGTH 7U |
◆ JSPR_TOPIC_NAME_MAX_LENGTH
| #define JSPR_TOPIC_NAME_MAX_LENGTH 57U |
◆ JSPR_VERSION_INFO_BUILD_INFO_LEN
| #define JSPR_VERSION_INFO_BUILD_INFO_LEN 50U |
◆ RX_BUFFER_SIZE
| #define RX_BUFFER_SIZE 8192U |
◆ TX_BUFFER_SIZE
| #define TX_BUFFER_SIZE 8192U |
◆ availableOperationalStates_t
| Enumerator |
|---|
| INACTIVE | |
| ACTIVE | |
| CAL_TEST | |
| HW_SELF_TEST | |
| RF_SCAN | |
| LOOPBACK | |
| FAULT | |
◆ availableSimInterfaces_t
| Enumerator |
|---|
| SIM_NONE | |
| SIM_LOCAL | |
| SIM_REMOTE | |
| SIM_INTERNAL | |
◆ jsprBootSource_t
| Enumerator |
|---|
| JSPR_BOOT_SOURCE_UNKNOWN | |
| JSPR_BOOT_SOURCE_PRIMARY | |
| JSPR_BOOT_SOURCE_FALLBACK | |
◆ jsprFinalMoStatus_t
| Enumerator |
|---|
| MO_ACK_RECEIVED_MOS | |
| MESSAGE_DISCARDED_ON_OVERFLOW_MOS | |
| MESSAGE_EXPIRED_MOS | |
| MESSAGE_TRANSFER_TIMEOUT_MOS | |
| SEGMENT_NOT_SUPPLIED_MOS | |
| SEGMENT_INCORRECT_MOS | |
| NETWORK_ERROR_MOS | |
| MESSAGE_CANCELLED_PRE_TRANSIT_MOS | |
| MESSAGE_CANCELLED_IN_TRANSIT_MOS | |
| SUBSCRIPTION_INVALID_MOS | |
| PROTOCOL_ERROR_MOS | |
| MESSAGE_DROPPED_LOCAL_CRC_ERROR_MOS | |
| CRC_ERROR_IN_TRANSFER_MOS | |
| USER_SUPPLIED_CRC_ERROR_MOS | |
◆ jsprFinalMtStatus_t
| Enumerator |
|---|
| COMPLETE | |
| MESSAGE_TIMED_OUT | |
| MESSAGE_CANCELLED | |
| CRC_ERROR_IN_TRANSFER | |
◆ jsprTopicPriority_t
| Enumerator |
|---|
| SAFETY_1 | |
| SAFETY_2 | |
| SAFETY_3 | |
| HIGH_PRIORITY | |
| MEDIUM_PRIORITY | |
| LOW_PRIORITY | |
◆ messageOriginateResponses_t
| Enumerator |
|---|
| MESSAGE_ACCEPTED | |
| SUBSCRIPTION_INVALID | |
| MESSAGE_DISCARDED_ON_OVERFLOW | |
◆ operationalStateReason_t
| Enumerator |
|---|
| NORMAL | |
| HARDWARE_SELF_TEST_FAILURE | |
| TEMPERATURE_FAULT | |
| RF_POWER_PROTECTION_FAULT | |
| VAM_APP_FAILED_ACK_INTERFACE_TRANSITION_FLOWING | |
| INVALID_HARDWARE | |
| LOW_SUPPLY_VOLTAGE | |
| MFRTEST_USED_INCORRECTLY | |
◆ responseCodes
| Enumerator |
|---|
| JSPR_RC_NO_ERROR | |
| JSPR_RC_UNSOLICITED_MESSAGE | |
| JSPR_RC_API_VERSION_NOT_SELECTED | |
| JSPR_RC_UNSUPPORTED_REQUEST_TYPE | |
| JSPR_RC_CONFIGURATION_ALREADY_SET | |
| JSPR_RC_COMMAND_TOO_LONG | |
| JSPR_RC_UNKNOWN_TARGET | |
| JSPR_RC_COMMAND_MALFORMED | |
| JSPR_RC_OPERATION_NOT_ALLOWED | |
| JSPR_RC_BAD_JSON | |
| JSPR_RC_REQUEST_FAILED | |
| JSPR_RC_UNAUTHORIZED | |
| JSPR_RC_SIM_NOT_CONFIGURED | |
| JSPR_RC_WAKE_XCVR_IN_INVALID | |
| JSPR_RC_INVALID_CHANNEL | |
| JSPR_RC_INVALID_ACTION | |
| JSPR_RC_HARDWARE_NOT_CONFIGURED | |
| JSPR_RC_INVALID_RADIO_PATH | |
| JSPR_RC_CRASH_DUMP_NOT_AVAILABLE | |
| JSPR_RC_FEATURE_NOT_SUPPORTED_BY_HARDWARE | |
| JSPR_RC_NOT_PROVISIONED | |
| JSPR_RC_INVALID_TRANSMIT_POWER | |
| JSPR_RC_INVALID_BURST_TYPE | |
| JSPR_RC_SERIAL_PORT_ERROR | |
◆ clearResponse()
◆ parseJsprBootInfo()
| bool parseJsprBootInfo |
( |
const char * |
jsprString, |
|
|
jsprBootInfo_t * |
bootInfo |
|
) |
| |
◆ parseJsprFirmwareInfo()
◆ parseJsprGetApiVersion()
| bool parseJsprGetApiVersion |
( |
char * |
jsprString, |
|
|
jsprApiVersion_t * |
apiVersion |
|
) |
| |
◆ parseJsprGetHwInfo()
| bool parseJsprGetHwInfo |
( |
char * |
jsprString, |
|
|
jsprHwInfo_t * |
hwInfo |
|
) |
| |
◆ parseJsprGetMessageProvisioning()
◆ parseJsprGetOperationalState()
◆ parseJsprGetSignal()
◆ parseJsprGetSimInterface()
◆ parseJsprGetSimStatus()
| bool parseJsprGetSimStatus |
( |
char * |
jsprString, |
|
|
jsprSimStatus_t * |
simStatus |
|
) |
| |
◆ parseJsprPutMessageOriginate()
◆ parseJsprUnsMessageOriginateSegment()
◆ parseJsprUnsMessageOriginateStatus()
◆ parseJsprUnsMessageTerminate()
◆ parseJsprUnsMessageTerminateSegment()
◆ parseJsprUnsMessageTerminateStatus()
◆ receiveJspr()
| bool receiveJspr |
( |
jsprResponse_t * |
response, |
|
|
const char * |
expectedTarget |
|
) |
| |
◆ sendJspr()
| int sendJspr |
( |
const char * |
buffer, |
|
|
size_t |
length |
|
) |
| |
◆ waitForJsprMessage()
| bool waitForJsprMessage |
( |
jsprResponse_t * |
response, |
|
|
const char * |
expectedTarget, |
|
|
const uint32_t |
expectedCode, |
|
|
const uint32_t |
timeoutSeconds |
|
) |
| |