Mensagem
Este módulo inclui funções que manipulam buffers de mensagens OpenThread.
Resumo
Enumerações | |
---|---|
otMessagePriority { | enumerar Essa enumeração define os níveis de prioridade da mensagem OpenThread. |
Typedefs | |
---|---|
otBufferInfo | typedefstruct otBufferInfo Essa estrutura representa as informações do buffer de mensagem para diferentes filas usadas pela pilha OpenThread. |
otMessage | typedefstruct otMessage Esse tipo é uma representação opaca de um buffer de mensagem OpenThread. |
otMessagePriority | typedefenum otMessagePriority Essa enumeração define os níveis de prioridade da mensagem OpenThread. |
otMessageQueueInfo | typedefstruct otMessageQueueInfo Essa estrutura representa informações sobre uma fila de mensagens. |
otMessageSettings | typedefstruct otMessageSettings Essa estrutura representa as configurações de uma mensagem. |
Funções | |
---|---|
otMessageAppend ( otMessage *aMessage, const void *aBuf, uint16_t aLength) | Acrescentar bytes a uma mensagem. |
otMessageFree ( otMessage *aMessage) | void Libera um buffer de mensagem alocado. |
otMessageGetBufferInfo ( otInstance *aInstance, otBufferInfo *aBufferInfo) | void Obtenha as informações do Buffer de Mensagens. |
otMessageGetLength (const otMessage *aMessage) | uint16_t Obtenha o comprimento da mensagem em bytes. |
otMessageGetOffset (const otMessage *aMessage) | uint16_t Obtenha o deslocamento da mensagem em bytes. |
otMessageGetRss (const otMessage *aMessage) | int8_t Esta função retorna o RSS médio (intensidade do sinal recebido) associado à mensagem. |
otMessageIsLinkSecurityEnabled (const otMessage *aMessage) | bool Esta função indica se a segurança do link está ou não habilitada para a mensagem. |
otMessageQueueDequeue ( otMessageQueue *aQueue, otMessage *aMessage) | void Esta função remove uma mensagem de uma determinada fila de mensagens. |
otMessageQueueEnqueue ( otMessageQueue *aQueue, otMessage *aMessage) | void Esta função adiciona uma mensagem ao final de uma determinada fila de mensagens. |
otMessageQueueEnqueueAtHead ( otMessageQueue *aQueue, otMessage *aMessage) | void Esta função adiciona uma mensagem no início/frente de uma determinada fila de mensagens. |
otMessageQueueGetHead ( otMessageQueue *aQueue) | Essa função retorna um ponteiro para a mensagem no início da fila. |
otMessageQueueGetNext ( otMessageQueue *aQueue, const otMessage *aMessage) | Essa função retorna um ponteiro para a próxima mensagem na fila iterando para frente (da cabeça para a cauda). |
otMessageQueueInit ( otMessageQueue *aQueue) | void Inicialize a fila de mensagens. |
otMessageRead (const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) | uint16_t Ler bytes de uma mensagem. |
otMessageSetDirectTransmission ( otMessage *aMessage, bool aEnabled) | void Esta função configura/força o encaminhamento da mensagem por meio de transmissão direta. |
otMessageSetLength ( otMessage *aMessage, uint16_t aLength) | Defina o comprimento da mensagem em bytes. |
otMessageSetOffset ( otMessage *aMessage, uint16_t aOffset) | void Defina o deslocamento da mensagem em bytes. |
otMessageWrite ( otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) | int Grava bytes em uma mensagem. |
Estruturas | |
---|---|
otBufferInfo | Essa estrutura representa as informações do buffer de mensagem para diferentes filas usadas pela pilha OpenThread. |
otMessageQueue | Essa estrutura representa uma fila de mensagens OpenThread. |
otMessageQueueInfo | Essa estrutura representa informações sobre uma fila de mensagens. |
otMessageSettings | Essa estrutura representa as configurações de uma mensagem. |
Enumerações
otMessagePriority
otMessagePriority
Typedefs
otBufferInfo
struct otBufferInfo otBufferInfo
Essa estrutura representa as informações do buffer de mensagem para diferentes filas usadas pela pilha OpenThread.
otMessage
struct otMessage otMessage
Esse tipo é uma representação opaca de um buffer de mensagem OpenThread.
otMessagePriority
enum otMessagePriority otMessagePriority
Essa enumeração define os níveis de prioridade da mensagem OpenThread.
otMessageQueueInfo
struct otMessageQueueInfo otMessageQueueInfo
Essa estrutura representa informações sobre uma fila de mensagens.
otMessageSettings
struct otMessageSettings otMessageSettings
Essa estrutura representa as configurações de uma mensagem.
Funções
otMessageAppend
otError otMessageAppend( otMessage *aMessage, const void *aBuf, uint16_t aLength )
Acrescentar bytes a uma mensagem.
Detalhes | |||||||
---|---|---|---|---|---|---|---|
Parâmetros |
| ||||||
Valores de retorno |
|
otMessageFree
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageFree
void otMessageFree( otMessage *aMessage )
Libera um buffer de mensagem alocado.
Detalhes | |||
---|---|---|---|
Parâmetros |
|
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageGetBufferInfo
void otMessageGetBufferInfo( otInstance *aInstance, otBufferInfo *aBufferInfo )
Obtenha as informações do Buffer de Mensagens.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageGetLength
uint16_t otMessageGetLength( const otMessage *aMessage )
Obtenha o comprimento da mensagem em bytes.
Detalhes | |||
---|---|---|---|
Parâmetros |
| ||
Devoluções | O comprimento da mensagem em bytes. |
otMessageFree
otMessageAppend
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageSetLength
otMessageGetOffset
uint16_t otMessageGetOffset( const otMessage *aMessage )
Obtenha o deslocamento da mensagem em bytes.
Detalhes | |||
---|---|---|---|
Parâmetros |
| ||
Devoluções | O valor de deslocamento da mensagem. |
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageGetRss
int8_t otMessageGetRss( const otMessage *aMessage )
Esta função retorna o RSS médio (intensidade do sinal recebido) associado à mensagem.
Detalhes | |
---|---|
Devoluções | O valor médio de RSS (em dBm) ou OT_RADIO_RSSI_INVALID se nenhum RSS médio estiver disponível. |
otMessageIsLinkSecurityEnabled
bool otMessageIsLinkSecurityEnabled( const otMessage *aMessage )
Esta função indica se a segurança do link está ou não habilitada para a mensagem.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
| ||||
Valores de retorno |
|
otMessageQueueDequeue
void otMessageQueueDequeue( otMessageQueue *aQueue, otMessage *aMessage )
Esta função remove uma mensagem de uma determinada fila de mensagens.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageQueueEnqueue
void otMessageQueueEnqueue( otMessageQueue *aQueue, otMessage *aMessage )
Esta função adiciona uma mensagem ao final de uma determinada fila de mensagens.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageQueueEnqueueAtHead
void otMessageQueueEnqueueAtHead( otMessageQueue *aQueue, otMessage *aMessage )
Esta função adiciona uma mensagem no início/frente de uma determinada fila de mensagens.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageQueueGetHead
otMessage * otMessageQueueGetHead( otMessageQueue *aQueue )
Essa função retorna um ponteiro para a mensagem no início da fila.
Detalhes | |||
---|---|---|---|
Parâmetros |
| ||
Devoluções | Um ponteiro para a mensagem no início da fila ou NULL se a fila estiver vazia. |
otMessageQueueGetNext
otMessage * otMessageQueueGetNext( otMessageQueue *aQueue, const otMessage *aMessage )
Essa função retorna um ponteiro para a próxima mensagem na fila iterando para frente (da cabeça para a cauda).
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
| ||||
Devoluções | Um ponteiro para a próxima mensagem na fila após aMessage ou NULL se aMessage is the tail of queue. NULL is returned if aMessage is not in the queue aQueue`. |
otMessageQueueInit
void otMessageQueueInit( otMessageQueue *aQueue )
Inicialize a fila de mensagens.
Esta função DEVE ser chamada uma vez e apenas uma vez para uma instância otMessageQueue
antes de qualquer outra função otMessageQueue
. O comportamento é indefinido se outras APIs de fila forem usadas com um otMessageQueue
antes de ser inicializado ou se for inicializado mais de uma vez.
Detalhes | |||
---|---|---|---|
Parâmetros |
|
otMessageRead
uint16_t otMessageRead( const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength )
Ler bytes de uma mensagem.
Detalhes | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parâmetros |
| ||||||||
Devoluções | O número de bytes lidos. |
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageWrite
otMessageSetDirectTransmission
void otMessageSetDirectTransmission( otMessage *aMessage, bool aEnabled )
Esta função configura/força o encaminhamento da mensagem por meio de transmissão direta.
A configuração padrão para uma nova mensagem é false
.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageSetLength
otError otMessageSetLength( otMessage *aMessage, uint16_t aLength )
Defina o comprimento da mensagem em bytes.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
| ||||
Valores de retorno |
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageSetOffset
void otMessageSetOffset( otMessage *aMessage, uint16_t aOffset )
Defina o deslocamento da mensagem em bytes.
Detalhes | |||||
---|---|---|---|---|---|
Parâmetros |
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageRead
otMessageWrite
otMessageWrite
int otMessageWrite( otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength )
Grava bytes em uma mensagem.
Detalhes | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parâmetros |
| ||||||||
Devoluções | O número de bytes gravados. |
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
Recursos
Os tópicos de referência da API OpenThread se originam do código-fonte, disponível no GitHub . Para obter mais informações ou contribuir com nossa documentação, consulte Recursos .