Cpc_system_common

Description

CPC System Endpoint Common.

Macros

#define EP_ID_TO_PROPERTY_ID (property, ep_id)   ((sli_cpc_property_id_t)((property) | ((ep_id) & 0x000000FF)))
Helper macros to convert a property and a endpoint id to an enum value.
#define PROPERTY_ID_TO_EP_ID (property_id)   ((uint8_t)(property_id) & 0x000000FF)
Helper macros to convert a property enum value to an endpoint id (uint8_t).
#define EP_ID_TO_PROPERTY_STATE (ep_id) EP_ID_TO_PROPERTY_ID (PROP_ENDPOINT_STATE_0, ep_id)
Helper macros to convert an enpoint id (uint8_t) to a PROP_ENDPOINT_STATE_x enum value.
#define EP_ID_TO_PROPERTY_ENCRYPTION (ep_id) EP_ID_TO_PROPERTY_ID (PROP_ENDPOINT_ENCRYPTION, ep_id)
Helper macros to convert an enpoint id (uint8_t) to a PROP_ENCRYPTION_STATE.
#define AGGREGATED_STATE_LOW (agg)   (( sl_cpc_endpoint_state_t )(agg & 0x0F))
Helper macros to extract the two aggregated endpoint states encoded in one single byte.
#define AGGREGATED_STATE_HIGH (agg)   (( sl_cpc_endpoint_state_t )(agg >> 4))
#define GET_ENDPOINT_STATE_FROM_STATES (payload, ep_id)
#define CPC_CAPABILITIES_SECURITY_ENDPOINT_MASK (1 << 0)
Capabilities mask.
#define CPC_CAPABILITIES_PACKED_ENDPOINT_MASK (1 << 1)
#define CPC_CAPABILITIES_GPIO_ENDPOINT_MASK (1 << 2)
#define CPC_CAPABILITIES_UART_FLOW_CONTROL_MASK (1 << 3)
#define PAYLOAD_LENGTH_MAX 16
System endpoint command type.

Enumerations

enum sl_cpc_system_status_t {
STATUS_OK = 0,
STATUS_FAILURE = 1,
STATUS_UNIMPLEMENTED = 2,
STATUS_INVALID_ARGUMENT = 3,
STATUS_INVALID_STATE = 4,
STATUS_INVALID_COMMAND = 5,
STATUS_INVALID_INTERFACE = 6,
STATUS_INTERNAL_ERROR = 7,
STATUS_SECURITY_ERROR = 8,
STATUS_PARSE_ERROR = 9,
STATUS_IN_PROGRESS = 10,
STATUS_NOMEM = 11,
STATUS_BUSY = 12,
STATUS_PROP_NOT_FOUND = 13,
STATUS_PACKET_DROPPED = 14,
STATUS_EMPTY = 15,
STATUS_CMD_TOO_BIG = 16,
STATUS_NO_ACK = 17,
STATUS_CCA_FAILURE = 18,
STATUS_ALREADY = 19,
STATUS_ITEM_NOT_FOUND = 20,
STATUS_INVALID_COMMAND_FOR_PROP = 21,
STATUS_RESET_POWER_ON = 112,
STATUS_RESET_EXTERNAL = 113,
STATUS_RESET_SOFTWARE = 114,
STATUS_RESET_FAULT = 115,
STATUS_RESET_CRASH = 116,
STATUS_RESET_ASSERT = 117,
STATUS_RESET_OTHER = 118,
STATUS_RESET_UNKNOWN = 119,
STATUS_RESET_WATCHDOG = 120
}
Enumeration representing spinel protocol status code.

Macro Definition Documentation

EP_ID_TO_PROPERTY_ID

#define EP_ID_TO_PROPERTY_ID ( property,
ep_id
) ((sli_cpc_property_id_t)((property) | ((ep_id) & 0x000000FF)))

Helper macros to convert a property and a endpoint id to an enum value.

PROPERTY_ID_TO_EP_ID

#define PROPERTY_ID_TO_EP_ID ( property_id ) ((uint8_t)(property_id) & 0x000000FF)

Helper macros to convert a property enum value to an endpoint id (uint8_t).

EP_ID_TO_PROPERTY_STATE

#define EP_ID_TO_PROPERTY_STATE ( ep_id ) EP_ID_TO_PROPERTY_ID (PROP_ENDPOINT_STATE_0, ep_id)

Helper macros to convert an enpoint id (uint8_t) to a PROP_ENDPOINT_STATE_x enum value.

EP_ID_TO_PROPERTY_ENCRYPTION

#define EP_ID_TO_PROPERTY_ENCRYPTION ( ep_id ) EP_ID_TO_PROPERTY_ID (PROP_ENDPOINT_ENCRYPTION, ep_id)

Helper macros to convert an enpoint id (uint8_t) to a PROP_ENCRYPTION_STATE.

AGGREGATED_STATE_LOW

#define AGGREGATED_STATE_LOW ( agg ) (( sl_cpc_endpoint_state_t )(agg & 0x0F))

Helper macros to extract the two aggregated endpoint states encoded in one single byte.

GET_ENDPOINT_STATE_FROM_STATES

#define GET_ENDPOINT_STATE_FROM_STATES ( payload,
ep_id
)
Value:
((ep_id % 2 == 0) ? AGGREGATED_STATE_LOW (((uint8_t*)payload)[ep_id / 2]) \
: AGGREGATED_STATE_HIGH(((uint8_t*)payload)[ep_id / 2]))

CPC_CAPABILITIES_SECURITY_ENDPOINT_MASK

#define CPC_CAPABILITIES_SECURITY_ENDPOINT_MASK   (1 << 0)

Capabilities mask.

Note
Used with the value returned by a property-get on PROP_CAPABILITIES.

PAYLOAD_LENGTH_MAX

#define PAYLOAD_LENGTH_MAX   16

System endpoint command type.

Enumeration Type Documentation

sl_cpc_system_status_t

Enumeration representing spinel protocol status code.

Enumerator
STATUS_OK

Operation has completed successfully.

STATUS_FAILURE

Operation has failed for some undefined reason.

STATUS_UNIMPLEMENTED

The given operation has not been implemented.

STATUS_INVALID_ARGUMENT

An argument to the given operation is invalid.

STATUS_INVALID_STATE

The given operation is invalid for the current state of the device.

STATUS_INVALID_COMMAND

The given command is not recognized.

STATUS_INVALID_INTERFACE

The given Spinel interface is not supported.

STATUS_INTERNAL_ERROR

An internal runtime error has occurred.

STATUS_SECURITY_ERROR

A security or authentication error has occurred.

STATUS_PARSE_ERROR

An error has occurred while parsing the command.

STATUS_IN_PROGRESS

The operation is in progress and will be completed asynchronously.

STATUS_NOMEM

The operation has been prevented due to memory pressure.

STATUS_BUSY

The device is currently performing a mutually exclusive operation.

STATUS_PROP_NOT_FOUND

The given property is not recognized.

STATUS_PACKET_DROPPED

The packet was dropped.

STATUS_EMPTY

The result of the operation is empty.

STATUS_CMD_TOO_BIG

The command was too large to fit in the internal buffer.

STATUS_NO_ACK

The packet was not acknowledged.

STATUS_CCA_FAILURE

The packet was not sent due to a CCA failure.

STATUS_ALREADY

The operation is already in progress or the property was already set to the given value.

STATUS_ITEM_NOT_FOUND

The given item could not be found in the property.

STATUS_INVALID_COMMAND_FOR_PROP

The given command cannot be performed on this property.