przekaz,
Ten moduł zawiera funkcje, które manipulowają buforami wiadomości OpenThread.
Podsumowanie
Wyliczenia |
|
---|---|
otMessagePriority{
|
enum | typ wyliczeniowy To wyliczenie definiuje poziomy komunikatów OpenThread. |
Typy |
|
---|---|
otBufferInfo
|
typedefstruct otBufferInfo
Ta struktura przedstawia informacje o buforze wiadomości dla różnych kolejek używanych przez stos OpenThread. |
otMessage
|
typedefstruct otMessage
Ten typ to nieprzezroczysta reprezentacja bufora wiadomości OpenThread. |
otMessagePriority
|
typedefenum otMessagePriority
To wyliczenie definiuje poziomy komunikatów OpenThread. |
otMessageQueueInfo
|
typedefstruct otMessageQueueInfo
Taka struktura przedstawia informacje o kolejce wiadomości. |
otMessageSettings
|
typedefstruct otMessageSettings
Taka struktura reprezentuje ustawienia wiadomości. |
Funkcje |
|
---|---|
otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength)
|
Dodawanie bajtów do wiadomości.
|
otMessageFree(otMessage *aMessage)
|
void
Zwolnij przypisany bufor wiadomości.
|
otMessageGetBufferInfo(otInstance *aInstance, otBufferInfo *aBufferInfo)
|
void
Pobieranie informacji o buforze wiadomości.
|
otMessageGetLength(const otMessage *aMessage)
|
uint16_t
Uzyskaj długość wiadomości w bajtach.
|
otMessageGetOffset(const otMessage *aMessage)
|
uint16_t
Uzyskaj przesunięcie wiadomości w bajtach.
|
otMessageGetRss(const otMessage *aMessage)
|
int8_t
Ta funkcja zwraca średnią wartość RSS (siłę sygnału odbieranego) powiązaną z wiadomością.
|
otMessageIsLinkSecurityEnabled(const otMessage *aMessage)
|
bool
Ta funkcja wskazuje, czy w wiadomości włączone jest zabezpieczenie linków.
|
otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage)
|
void
Ta funkcja usuwa wiadomość z kolejki.
|
otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage)
|
void
Ta funkcja dodaje wiadomość na końcu danej kolejki wiadomości.
|
otMessageQueueEnqueueAtHead(otMessageQueue *aQueue, otMessage *aMessage)
|
void
Ta funkcja dodaje wiadomość w nagłówku/na początku danej kolejki wiadomości.
|
otMessageQueueGetHead(otMessageQueue *aQueue)
|
Ta funkcja zwraca wskaźnik do wiadomości na początku kolejki.
|
otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage)
|
Ta funkcja zwraca wskaźnik do następnej wiadomości w kolejce przez iterowanie dalej (od nagłówka do końca).
|
otMessageQueueInit(otMessageQueue *aQueue)
|
void
Zainicjuj kolejkę wiadomości.
|
otMessageRead(const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength)
|
uint16_t
Odczytaj bajty z wiadomości.
|
otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled)
|
void
Ta funkcja ustawia lub wymusza przekazywanie wiadomości za pomocą transmisji bezpośredniej.
|
otMessageSetLength(otMessage *aMessage, uint16_t aLength)
|
Ustaw długość wiadomości w bajtach.
|
otMessageSetOffset(otMessage *aMessage, uint16_t aOffset)
|
void
Ustaw przesunięcie wiadomości w bajtach.
|
otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength)
|
int
Napisz bajty w wiadomości.
|
Struktury |
|
---|---|
otBufferInfo |
Ta struktura przedstawia informacje o buforze wiadomości dla różnych kolejek używanych przez stos OpenThread. |
kolejkawiadomości |
Ta struktura reprezentuje kolejkę wiadomości OpenThread. |
otMessageQueueInfo |
Taka struktura przedstawia informacje o kolejce wiadomości. |
otMessageSettings |
Taka struktura reprezentuje ustawienia wiadomości. |
Wyliczenia
otMessagePriority,
otMessagePriority
To wyliczenie definiuje poziomy komunikatów OpenThread.
Właściwości | |
---|---|
OT_MESSAGE_PRIORITY_HIGH
|
Wysoki priorytet. |
OT_MESSAGE_PRIORITY_LOW
|
Niski priorytet. |
OT_MESSAGE_PRIORITY_NORMAL
|
Normalny priorytet. |
Typy
Informacje o OTBuffer
struct otBufferInfo otBufferInfo
Ta struktura przedstawia informacje o buforze wiadomości dla różnych kolejek używanych przez stos OpenThread.
otMessage
struct otMessage otMessage
Ten typ to nieprzezroczysta reprezentacja bufora wiadomości OpenThread.
otMessagePriority,
enum otMessagePriority otMessagePriority
To wyliczenie definiuje poziomy komunikatów OpenThread.
ieMessageQueueInfo
struct otMessageQueueInfo otMessageQueueInfo
Taka struktura przedstawia informacje o kolejce wiadomości.
Ustawienia wiadomości
struct otMessageSettings otMessageSettings
Taka struktura reprezentuje ustawienia wiadomości.
Funkcje
otMessageAttach
otError otMessageAppend( otMessage *aMessage, const void *aBuf, uint16_t aLength )
Dodawanie bajtów do wiadomości.
Szczegóły | |||||||
---|---|---|---|---|---|---|---|
Parametry |
|
||||||
Zwracane wartości |
|
otMessageFree
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
OTMessageFree
void otMessageFree( otMessage *aMessage )
Zwolnij przypisany bufor wiadomości.
Szczegóły | |||
---|---|---|---|
Parametry |
|
otMessageAttach
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageGetBufferInfo
void otMessageGetBufferInfo( otInstance *aInstance, otBufferInfo *aBufferInfo )
Pobieranie informacji o buforze wiadomości.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
Długość wiadomościOot
uint16_t otMessageGetLength( const otMessage *aMessage )
Uzyskaj długość wiadomości w bajtach.
Szczegóły | |||
---|---|---|---|
Parametry |
|
||
Zwroty |
Długość wiadomości w bajtach.
|
otMessageFree
otMessageAttach
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageSetLength
OTMessageGetOffset.
uint16_t otMessageGetOffset( const otMessage *aMessage )
Uzyskaj przesunięcie wiadomości w bajtach.
Szczegóły | |||
---|---|---|---|
Parametry |
|
||
Zwroty |
Wartość przesunięcia wiadomości.
|
otMessageFree
otMessageAttach
otMessageGetLength
otMessageSetLength
otMessageSetOffset
otMessageRead
otMessageWrite
OTMessageGetRss
int8_t otMessageGetRss( const otMessage *aMessage )
Ta funkcja zwraca średnią wartość RSS (siłę sygnału odbieranego) powiązaną z wiadomością.
Szczegóły | |
---|---|
Zwroty |
Średnia wartość RSS (w dBm) lub OT_RADIO_RSSI_INVALID, jeśli nie jest dostępny średni RSS.
|
otMessageIsLinkSecurityEnabled
bool otMessageIsLinkSecurityEnabled( const otMessage *aMessage )
Ta funkcja wskazuje, czy w wiadomości włączone jest zabezpieczenie linków.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
||||
Zwracane wartości |
|
OTMessageQueue Dequeue
void otMessageQueueDequeue( otMessageQueue *aQueue, otMessage *aMessage )
Ta funkcja usuwa wiadomość z kolejki.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
KolejkaOtMessageQueue
void otMessageQueueEnqueue( otMessageQueue *aQueue, otMessage *aMessage )
Ta funkcja dodaje wiadomość na końcu danej kolejki wiadomości.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
OTMessageQueueEnqueueAtHEAD
void otMessageQueueEnqueueAtHead( otMessageQueue *aQueue, otMessage *aMessage )
Ta funkcja dodaje wiadomość w nagłówku/na początku danej kolejki wiadomości.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
OTMessageQueueGetHead
otMessage * otMessageQueueGetHead( otMessageQueue *aQueue )
Ta funkcja zwraca wskaźnik do wiadomości na początku kolejki.
Szczegóły | |||
---|---|---|---|
Parametry |
|
||
Zwroty |
Wskaźnik wskazujący wiadomość na początku kolejki lub wartość NULL, jeśli kolejka jest pusta.
|
OTMessageQueueGetNext
otMessage * otMessageQueueGetNext( otMessageQueue *aQueue, const otMessage *aMessage )
Ta funkcja zwraca wskaźnik do następnej wiadomości w kolejce przez iterowanie dalej (od nagłówka do końca).
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
||||
Zwroty |
Wskaźnik do następnej wiadomości w kolejce po
aMessage lub NULL, jeśli aMessage is the tail of queue. NULL is returned if aMessageis not in the queue aQueue`. |
OTMessageQueueInit
void otMessageQueueInit( otMessageQueue *aQueue )
Zainicjuj kolejkę wiadomości.
Ta funkcja MUSI zostać wywołana tylko raz dla instancji otMessageQueue
przed innymi funkcjami otMessageQueue
. Działanie jest niezdefiniowane, jeśli przed inicjacją otMessageQueue
użyto innych interfejsów API kolejki lub inicjujesz je więcej niż raz.
Szczegóły | |||
---|---|---|---|
Parametry |
|
OTMessageRead
uint16_t otMessageRead( const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength )
Odczytaj bajty z wiadomości.
Szczegóły | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametry |
|
||||||||
Zwroty |
Liczba odczytanych bajtów.
|
otMessageFree
otMessageAttach
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageWrite
OTMessageSetDirectTransmission
void otMessageSetDirectTransmission( otMessage *aMessage, bool aEnabled )
Ta funkcja ustawia lub wymusza przekazywanie wiadomości za pomocą transmisji bezpośredniej.
Ustawienie domyślne nowej wiadomości to false
.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
Długość wiadomości w grupie
otError otMessageSetLength( otMessage *aMessage, uint16_t aLength )
Ustaw długość wiadomości w bajtach.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
||||
Zwracane wartości |
|
otMessageFree
otMessageAttach
otMessageGetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
OTMessageSetOffset
void otMessageSetOffset( otMessage *aMessage, uint16_t aOffset )
Ustaw przesunięcie wiadomości w bajtach.
Szczegóły | |||||
---|---|---|---|---|---|
Parametry |
|
otMessageFree
otMessageAttach
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageRead
otMessageWrite
otMessageWrite
int otMessageWrite( otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength )
Napisz bajty w wiadomości.
Szczegóły | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametry |
|
||||||||
Zwroty |
Liczba zapisanych bajtów.
|
otMessageFree
otMessageAttach
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
Zasoby
Tematy referencyjne interfejsu API OpenThread pochodzą z kodu źródłowego i są dostępne w GitHub. Więcej informacji oraz dodatkowe informacje znajdziesz w materiałach.