Copa Airlines
Questo modulo include funzioni che controllano la comunicazione CoAP.
Riepilogo
Le funzioni in questo modulo sono disponibili quando la funzionalità API CoAP (OPENTHREAD_CONFIG_COAP_API_ENABLE
) è abilitata.
Typedef |
|
---|---|
otCoapBlockSzx
|
typedefenum otCoapBlockSzx
Esponenti di dimensione dei blocchi CoAP. |
otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
|
typedefotError(*
Questo puntatore di funzione viene chiamato quando viene ricevuto un messaggio CoAP con un'opzione di trasferimento a blocchi. |
otCoapBlockwiseResource
|
typedefstruct otCoapBlockwiseResource
Questa struttura rappresenta una risorsa CoAP con trasferimento a blocchi. |
otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
|
typedefotError(*
Questo puntatore di funzione viene chiamato prima dell'invio del blocco successivo in un trasferimento a blocchi. |
otCoapCode
|
typedefenum otCoapCode
Valori del codice CoAP. |
otCoapOption
|
typedefstruct otCoapOption
Questa struttura rappresenta un'opzione CoAP. |
otCoapOptionContentFormat
|
typedef Codici del formato dei contenuti CoAP. |
otCoapOptionIterator
|
typedefstruct otCoapOptionIterator
Questa struttura funge da iteratore delle opzioni CoAP. |
otCoapOptionType
|
typedefenum otCoapOptionType
Numeri opzione CoAP. |
otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefvoid(*
Questo puntatore di funzione viene chiamato quando viene ricevuta una richiesta CoAP con un Uri-Path specifico. |
otCoapResource
|
typedefstruct otCoapResource
Questa struttura rappresenta una risorsa CoAP. |
otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
|
typedefvoid(*
Questo puntatore di funzione viene chiamato quando viene ricevuta una risposta CoAP o al timeout della richiesta. |
otCoapTxParameters
|
typedefstruct otCoapTxParameters
Questa struttura rappresenta i parametri di trasmissione della CoAP. |
otCoapType
|
typedefenum otCoapType
Valori del tipo CoAP (numero intero senza segno a 2 bit). |
Functions |
|
---|---|
otCoapAddBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
Questa funzione aggiunge una risorsa a blocchi al server CoAP.
|
otCoapAddResource(otInstance *aInstance, otCoapResource *aResource)
|
void
Questa funzione aggiunge una risorsa al server CoAP.
|
otCoapBlockSizeFromExponent(otCoapBlockSzx aSize)
|
uint16_t
Questa funzione converte un campo SZX con opzione di blocco CoAP nella dimensione effettiva del blocco.
|
otCoapMessageAppendBlock1Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
Questa funzione aggiunge un'opzione Block1.
|
otCoapMessageAppendBlock2Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
Questa funzione aggiunge un'opzione Block2.
|
otCoapMessageAppendContentFormatOption(otMessage *aMessage, otCoapOptionContentFormat aContentFormat)
|
Questa funzione aggiunge l'opzione Content Format CoAP come specificato in https://tools.ietf.org/html/rfc7252#page-92.
|
otCoapMessageAppendMaxAgeOption(otMessage *aMessage, uint32_t aMaxAge)
|
Questa funzione aggiunge un'opzione per Max-Age.
|
otCoapMessageAppendObserveOption(otMessage *aMessage, uint32_t aObserve)
|
Questa funzione aggiunge un'opzione di osservazione.
|
otCoapMessageAppendOption(otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue)
|
Questa funzione aggiunge un'opzione CoAP a un'intestazione.
|
otCoapMessageAppendProxyUriOption(otMessage *aMessage, const char *aUriPath)
|
Questa funzione aggiunge un'opzione Proxy-Uri.
|
otCoapMessageAppendUintOption(otMessage *aMessage, uint16_t aNumber, uint32_t aValue)
|
Questa funzione aggiunge un'opzione CoAP Intera senza firma come specificata in https://tools.ietf.org/html/rfc7252#section-3.2.
|
otCoapMessageAppendUriPathOptions(otMessage *aMessage, const char *aUriPath)
|
Questa funzione aggiunge un'opzione Uri-Path.
|
otCoapMessageAppendUriQueryOption(otMessage *aMessage, const char *aUriQuery)
|
Questa funzione aggiunge una singola opzione Uri-Query.
|
otCoapMessageCodeToString(const otMessage *aMessage)
|
const char *
Questo metodo restituisce il codice CoAP come stringa leggibile dall'uomo.
|
otCoapMessageGenerateToken(otMessage *aMessage, uint8_t aTokenLength)
|
void
Questa funzione imposta la lunghezza del token e ne randomizza il valore.
|
otCoapMessageGetCode(const otMessage *aMessage)
|
Questa funzione restituisce il valore Codice.
|
otCoapMessageGetMessageId(const otMessage *aMessage)
|
uint16_t
Questa funzione restituisce il valore ID messaggio.
|
otCoapMessageGetToken(const otMessage *aMessage)
|
const uint8_t *
Questa funzione restituisce un puntatore al valore del token.
|
otCoapMessageGetTokenLength(const otMessage *aMessage)
|
uint8_t
Questa funzione restituisce la lunghezza del token.
|
otCoapMessageGetType(const otMessage *aMessage)
|
Questa funzione restituisce il valore Type.
|
otCoapMessageInit(otMessage *aMessage, otCoapType aType, otCoapCode aCode)
|
void
Questa funzione inizializza l'intestazione CoAP.
|
otCoapMessageInitResponse(otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode)
|
Questa funzione inizializza un messaggio di risposta.
|
otCoapMessageSetCode(otMessage *aMessage, otCoapCode aCode)
|
void
Questa funzione imposta il valore Codice.
|
otCoapMessageSetPayloadMarker(otMessage *aMessage)
|
Questa funzione aggiunge un indicatore di payload all'inizio del payload all'intestazione CoAP.
|
otCoapMessageSetToken(otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength)
|
Questa funzione imposta il valore e la lunghezza del token in un'intestazione.
|
otCoapNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
Questa funzione crea un nuovo messaggio CoAP.
|
otCoapOptionIteratorGetFirstOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
Questa funzione restituisce un puntatore alla prima opzione.
|
otCoapOptionIteratorGetFirstOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
Questa funzione restituisce un puntatore alla prima opzione corrispondente al numero di opzione specificato.
|
otCoapOptionIteratorGetNextOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
Questa funzione restituisce un puntatore all'opzione successiva.
|
otCoapOptionIteratorGetNextOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
Questa funzione restituisce un puntatore all'opzione successiva corrispondente al numero di opzione specificato.
|
otCoapOptionIteratorGetOptionUintValue(otCoapOptionIterator *aIterator, uint64_t *aValue)
|
Questa funzione riempie il valore dell'opzione corrente in
aValue supponendo che il valore corrente sia un numero intero senza segno codificato in base a https://tools.ietf.org/html/rfc7252#section-3.2. |
otCoapOptionIteratorGetOptionValue(otCoapOptionIterator *aIterator, void *aValue)
|
Questa funzione inserisce il valore dell'opzione corrente in
aValue . |
otCoapOptionIteratorInit(otCoapOptionIterator *aIterator, const otMessage *aMessage)
|
Questa funzione inizializza un iteratore per le opzioni nel messaggio specificato.
|
otCoapRemoveBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
Questa funzione rimuove una risorsa a blocchi dal server CoAP.
|
otCoapRemoveResource(otInstance *aInstance, otCoapResource *aResource)
|
void
Questa funzione rimuove una risorsa dal server CoAP.
|
otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext)
|
Questa funzione invia una richiesta CoAP.
|
otCoapSendRequestBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
Questa funzione invia una richiesta CoAP in modalità di blocco.
|
otCoapSendRequestBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
Questa funzione invia una richiesta CoAP a blocchi con parametri di trasmissione personalizzati.
|
otCoapSendRequestWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters)
|
Questa funzione invia una richiesta CoAP con parametri di trasmissione personalizzati.
|
otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
Questa funzione invia una risposta CoAP dal server.
|
otCoapSendResponseBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
Questa funzione invia una risposta CoAP in modalità di blocco dal server.
|
otCoapSendResponseBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
Questa funzione invia dal server una risposta di blocco CoAP con parametri di trasmissione personalizzati.
|
otCoapSendResponseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters)
|
Questa funzione invia una risposta CoAP dal server con parametri di trasmissione personalizzati.
|
otCoapSetDefaultHandler(otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext)
|
void
Questa funzione imposta il gestore predefinito per le richieste CoAP non gestite.
|
otCoapStart(otInstance *aInstance, uint16_t aPort)
|
Questa funzione avvia il server CoAP.
|
otCoapStop(otInstance *aInstance)
|
Questa funzione arresta il server CoAP.
|
Punti ristoro |
|
---|---|
otCoapBlockwiseResource |
Questa struttura rappresenta una risorsa CoAP con trasferimento a blocchi. |
Opzione OtCoap |
Questa struttura rappresenta un'opzione CoAP. |
otCoapOptionIterator |
Questa struttura funge da iteratore delle opzioni CoAP. |
otCoapResource |
Questa struttura rappresenta una risorsa CoAP. |
otCoapTxParameters |
Questa struttura rappresenta i parametri di trasmissione della CoAP. |
Enumerazioni
otCoapBlockSzx
otCoapBlockSzx
Esponenti di dimensione dei blocchi CoAP.
otCoapCode
otCoapCode
Valori del codice CoAP.
otCoapOptionContentFormat
otCoapOptionContentFormat
Codici del formato dei contenuti CoAP.
L'elenco completo è documentato all'indirizzo https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats
Proprietà | |
---|---|
OT_COAP_OPTION_CONTENT_FORMAT_CBOR
|
applicazione/cbor: [RFC7049] |
OT_COAP_OPTION_CONTENT_FORMAT_COAP_GROUP_JSON
|
applicazione/coap-group+json: [RFC7390] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT
|
applicazione/cose; cose-type="cose-encrypt": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT0
|
applicazione/cose; cose-type="cose-encrypt0": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY
|
applicazione/chiave chiave: [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY_SET
|
applicazione/cose-key-set: [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC
|
applicazione/cose; cose-type="cose-mac": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC0
|
applicazione/cose; cose-type="cose-mac0": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN
|
applicazione/cose; cose-type="cose-sign": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN1
|
applicazione/cose; cose-type="cose-sign1": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_CWT
|
applicazione/cwt: [RFC8392] |
OT_COAP_OPTION_CONTENT_FORMAT_EXI
|
application/exi: ["efficient XML Interchange (EXI) Format 1.0 (Second Edition)", febbraio 2014] |
OT_COAP_OPTION_CONTENT_FORMAT_JSON
|
applicazione/json: [RFC7159] |
OT_COAP_OPTION_CONTENT_FORMAT_JSON_PATCH_JSON
|
applicazione/json-patch+json: [RFC6902] |
OT_COAP_OPTION_CONTENT_FORMAT_LINK_FORMAT
|
applicazione/formato del link: [RFC6690] |
OT_COAP_OPTION_CONTENT_FORMAT_MERGE_PATCH_JSON
|
applicazione/merge-patch+json: [RFC7396] |
OT_COAP_OPTION_CONTENT_FORMAT_OCTET_STREAM
|
applicazione/octet-stream: [RFC2045][RFC2046] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_CBOR
|
applicazione/senml+cbor: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_EXI
|
applicazione/senml-exi: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_JSON
|
applicazione/senml+json: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_XML
|
applicazione/senml+xml: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_CBOR
|
applicazione/sensml+cbor: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_EXI
|
applicazione/sensml-exi: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_JSON
|
applicazione/sensml+json: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_XML
|
applicazione/sensml+xml: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_TEXT_PLAIN
|
text/plain; charset=utf-8: [RFC2046][RFC3676][RFC5147] |
OT_COAP_OPTION_CONTENT_FORMAT_XML
|
applicazione/xml: [RFC3023] |
otCoapOptionType
otCoapOptionType
Numeri opzione CoAP.
Proprietà | |
---|---|
OT_COAP_OPTION_ACCEPT
|
Accettali. |
OT_COAP_OPTION_BLOCK1
|
Block1 (RFC7959) |
OT_COAP_OPTION_BLOCK2
|
Block2 (RFC7959) |
OT_COAP_OPTION_CONTENT_FORMAT
|
Formato contenuti. |
OT_COAP_OPTION_E_TAG
|
ETag. |
OT_COAP_OPTION_IF_MATCH
|
If-Match. |
OT_COAP_OPTION_IF_NONE_MATCH
|
If-None-Match. |
OT_COAP_OPTION_LOCATION_PATH
|
Percorso. |
OT_COAP_OPTION_LOCATION_QUERY
|
Query località. |
OT_COAP_OPTION_MAX_AGE
|
Età massima. |
OT_COAP_OPTION_OBSERVE
|
Osserva [RFC7641]. |
OT_COAP_OPTION_PROXY_SCHEME
|
Proxy-schema. |
OT_COAP_OPTION_PROXY_URI
|
URI proxy |
OT_COAP_OPTION_SIZE1
|
Taglia1. |
OT_COAP_OPTION_SIZE2
|
Taglia 2 (RFC7959) |
OT_COAP_OPTION_URI_HOST
|
Uri-host. |
OT_COAP_OPTION_URI_PATH
|
Uri-path. |
OT_COAP_OPTION_URI_PORT
|
URI. |
OT_COAP_OPTION_URI_QUERY
|
Uri-query. |
otCoapType
otCoapType
Valori del tipo CoAP (numero intero senza segno a 2 bit).
Proprietà | |
---|---|
OT_COAP_TYPE_ACKNOWLEDGMENT
|
Accettazione. |
OT_COAP_TYPE_CONFIRMABLE
|
Confermabile. |
OT_COAP_TYPE_NON_CONFIRMABLE
|
Non confermabile. |
OT_COAP_TYPE_RESET
|
Reimposta. |
Typedef
otCoapBlockwiseReceiveHook
otError(* otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
Questo puntatore di funzione viene chiamato quando viene ricevuto un messaggio CoAP con un'opzione di trasferimento a blocchi.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Dettagli | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||
Valori restituiti |
|
otCoapBlockwiseResource
struct otCoapBlockwiseResource otCoapBlockwiseResource
Questa struttura rappresenta una risorsa CoAP con trasferimento a blocchi.
otCoapBlockwiseTransmitHook
otError(* otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
Questo puntatore di funzione viene chiamato prima dell'invio del blocco successivo in un trasferimento a blocchi.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Modificando il valore di aBlockLength, viene rinegoziata la dimensione del blocco dell'intera piattaforma di scambio. Ti consigliamo di eseguire questa operazione dopo la ricezione del primo blocco, poiché le modifiche successive potrebbero causare problemi con altre implementazioni CoAP.
Dettagli | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||
Valori restituiti |
|
otCoapOptionContentFormat
enum otCoapOptionContentFormat otCoapOptionContentFormat
Codici del formato dei contenuti CoAP.
L'elenco completo è documentato all'indirizzo https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats
otCoapOptionIterator
struct otCoapOptionIterator otCoapOptionIterator
Questa struttura funge da iteratore delle opzioni CoAP.
otCoapRequestHandler
void(* otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
Questo puntatore di funzione viene chiamato quando viene ricevuta una richiesta CoAP con un Uri-Path specifico.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
otCoapResponseHandler
void(* otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
Questo puntatore di funzione viene chiamato quando viene ricevuta una risposta CoAP o al timeout della richiesta.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapTxParameters
struct otCoapTxParameters otCoapTxParameters
Questa struttura rappresenta i parametri di trasmissione della CoAP.
di Google Cloud.Functions
otCoapAddBlockWiseResource
void otCoapAddBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
Questa funzione aggiunge una risorsa a blocchi al server CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapAddResource
void otCoapAddResource( otInstance *aInstance, otCoapResource *aResource )
Questa funzione aggiunge una risorsa al server CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapBlockSizeFromExponent
uint16_t otCoapBlockSizeFromExponent( otCoapBlockSzx aSize )
Questa funzione converte un campo SZX con opzione di blocco CoAP nella dimensione effettiva del blocco.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Il valore effettivo della dimensione dell'esponente.
|
otCoapMessageAppendBlock1Option
otError otCoapMessageAppendBlock1Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
Questa funzione aggiunge un'opzione Block1.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapMessageAppendBlock2Option
otError otCoapMessageAppendBlock2Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
Questa funzione aggiunge un'opzione Block2.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapMessageAppendContentFormatOption
otError otCoapMessageAppendContentFormatOption( otMessage *aMessage, otCoapOptionContentFormat aContentFormat )
Questa funzione aggiunge l'opzione Content Format CoAP come specificato in https://tools.ietf.org/html/rfc7252#page-92.
Questo deve essere chiamato prima di impostare otCoapMessageSetPayloadMarker se un payload deve essere incluso nel messaggio.
La funzione è un wrapper pratico per otCoapMessageAppendUintOption e, se il codice del tipo di formato desiderato non è nell'elenco in otCoapOptionContentFormat, deve essere utilizzata questa funzione base.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendMaxAgeOption
otError otCoapMessageAppendMaxAgeOption( otMessage *aMessage, uint32_t aMaxAge )
Questa funzione aggiunge un'opzione per Max-Age.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendObserveOption
otError otCoapMessageAppendObserveOption( otMessage *aMessage, uint32_t aObserve )
Questa funzione aggiunge un'opzione di osservazione.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendOption
otError otCoapMessageAppendOption( otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue )
Questa funzione aggiunge un'opzione CoAP a un'intestazione.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapMessageAppendProxyUriOption
otError otCoapMessageAppendProxyUriOption( otMessage *aMessage, const char *aUriPath )
Questa funzione aggiunge un'opzione Proxy-Uri.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendUintOption
otError otCoapMessageAppendUintOption( otMessage *aMessage, uint16_t aNumber, uint32_t aValue )
Questa funzione aggiunge un'opzione CoAP Intera senza firma come specificata in https://tools.ietf.org/html/rfc7252#section-3.2.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageGetOptionUintValue
Opzioni otCoapMessageAppendUriPathOptions
otError otCoapMessageAppendUriPathOptions( otMessage *aMessage, const char *aUriPath )
Questa funzione aggiunge un'opzione Uri-Path.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendUriQueryOption
otError otCoapMessageAppendUriQueryOption( otMessage *aMessage, const char *aUriQuery )
Questa funzione aggiunge una singola opzione Uri-Query.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageCodeToString
const char * otCoapMessageCodeToString( const otMessage *aMessage )
Questo metodo restituisce il codice CoAP come stringa leggibile dall'uomo.
@ restituisce il codice CoAP come stringa.
Dettagli | |||
---|---|---|---|
Parametri |
|
otCoapMessageGenerateToken
void otCoapMessageGenerateToken( otMessage *aMessage, uint8_t aTokenLength )
Questa funzione imposta la lunghezza del token e ne randomizza il valore.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapMessageGetCode
otCoapCode otCoapMessageGetCode( const otMessage *aMessage )
Questa funzione restituisce il valore Codice.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Il valore Codice.
|
otCoapMessageGetMessageId
uint16_t otCoapMessageGetMessageId( const otMessage *aMessage )
Questa funzione restituisce il valore ID messaggio.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Il valore dell'ID messaggio.
|
otCoapMessageGetToken
const uint8_t * otCoapMessageGetToken( const otMessage *aMessage )
Questa funzione restituisce un puntatore al valore del token.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Un puntatore al valore token.
|
otCoapMessageGetTokenLength
uint8_t otCoapMessageGetTokenLength( const otMessage *aMessage )
Questa funzione restituisce la lunghezza del token.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
La lunghezza del token.
|
otCoapMessageGetType
otCoapType otCoapMessageGetType( const otMessage *aMessage )
Questa funzione restituisce il valore Type.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Il valore Type.
|
otCoapMessageInit
void otCoapMessageInit( otMessage *aMessage, otCoapType aType, otCoapCode aCode )
Questa funzione inizializza l'intestazione CoAP.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
otCoapMessageInitResponse
otError otCoapMessageInitResponse( otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode )
Questa funzione inizializza un messaggio di risposta.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapMessageSetCode
void otCoapMessageSetCode( otMessage *aMessage, otCoapCode aCode )
Questa funzione imposta il valore Codice.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapMessageSetPayloadMarker
otError otCoapMessageSetPayloadMarker( otMessage *aMessage )
Questa funzione aggiunge un indicatore di payload all'inizio del payload all'intestazione CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otCoapMessageSetToken
otError otCoapMessageSetToken( otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength )
Questa funzione imposta il valore e la lunghezza del token in un'intestazione.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapNewMessage
otMessage * otCoapNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
Questa funzione crea un nuovo messaggio CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Resi |
Un puntatore al buffer dei messaggi o NULL se non sono disponibili buffer di messaggi o parametri non validi.
|
otCoapOptionIteratorGetFirstOption
const otCoapOption * otCoapOptionIteratorGetFirstOption( otCoapOptionIterator *aIterator )
Questa funzione restituisce un puntatore alla prima opzione.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Un puntatore alla prima opzione. Se non è presente alcuna opzione, viene restituito un puntatore NULL.
|
otCoapOptionIteratorGetFirstOptionMatching
const otCoapOption * otCoapOptionIteratorGetFirstOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
Questa funzione restituisce un puntatore alla prima opzione corrispondente al numero di opzione specificato.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Resi |
Un puntatore alla prima opzione di corrispondenza. Se non è presente alcuna opzione di corrispondenza, viene restituito un puntatore NULL.
|
otCoapOptionIteratorGetNextOption
const otCoapOption * otCoapOptionIteratorGetNextOption( otCoapOptionIterator *aIterator )
Questa funzione restituisce un puntatore all'opzione successiva.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Resi |
Un puntatore all'opzione successiva. Se non sono presenti altre opzioni, viene restituito un puntatore NULL.
|
otCoapOptionIteratorGetNextOptionMatching
const otCoapOption * otCoapOptionIteratorGetNextOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
Questa funzione restituisce un puntatore all'opzione successiva corrispondente al numero di opzione specificato.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Resi |
Un puntatore alla successiva opzione di corrispondenza. Se non è presente alcuna ulteriore opzione di corrispondenza, viene restituito un puntatore NULL.
|
otCoapOptionIteratorGetOptionUintValue
otError otCoapOptionIteratorGetOptionUintValue( otCoapOptionIterator *aIterator, uint64_t *aValue )
Questa funzione riempie il valore dell'opzione corrente in aValue
supponendo che il valore corrente sia un numero intero senza segno codificato in base a https://tools.ietf.org/html/rfc7252#section-3.2.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapMessageAppendUintOption
otCoapOptionIteratorGetOptionValue
otError otCoapOptionIteratorGetOptionValue( otCoapOptionIterator *aIterator, void *aValue )
Questa funzione inserisce il valore dell'opzione corrente in aValue
.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otCoapOptionIteratorInit
otError otCoapOptionIteratorInit( otCoapOptionIterator *aIterator, const otMessage *aMessage )
Questa funzione inizializza un iteratore per le opzioni nel messaggio specificato.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otCoapRemoveBlockWiseResource
void otCoapRemoveBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
Questa funzione rimuove una risorsa a blocchi dal server CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapRemoveResource
void otCoapRemoveResource( otInstance *aInstance, otCoapResource *aResource )
Questa funzione rimuove una risorsa dal server CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
otCoapSendRequest
otError otCoapSendRequest( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext )
Questa funzione invia una richiesta CoAP.
Se è prevista una risposta per una richiesta, è necessario fornire le rispettive informazioni su funzione e contesto. Se non è prevista alcuna risposta, questi argomenti devono essere puntatori NULL.
Dettagli | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||
Valori restituiti |
|
otCoapSendRequestBlockWise
otError otCoapSendRequestBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
Questa funzione invia una richiesta CoAP in modalità di blocco.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Se è prevista una risposta per una richiesta, è necessario fornire le rispettive informazioni su funzione e contesto. Se si prevede che la risposta sia a blocchi, deve essere fornita una rispettiva funzione di hook. Se non è prevista alcuna risposta, questi argomenti devono essere puntatori NULL.
Dettagli | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||||
Valori restituiti |
|
otCoapSendRequestBlockWiseWithParameters
otError otCoapSendRequestBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
Questa funzione invia una richiesta CoAP a blocchi con parametri di trasmissione personalizzati.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Se è prevista una risposta per una richiesta, è necessario fornire le rispettive informazioni su funzione e contesto. Se si prevede che la risposta sia a blocchi, deve essere fornita una rispettiva funzione di hook. Se non è prevista alcuna risposta, questi argomenti devono essere puntatori NULL.
Dettagli | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||||||
Valori restituiti |
|
otCoapSendRequestWithParameters
otError otCoapSendRequestWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters )
Questa funzione invia una richiesta CoAP con parametri di trasmissione personalizzati.
Se è prevista una risposta per una richiesta, è necessario fornire le rispettive informazioni su funzione e contesto. Se non è prevista alcuna risposta, questi argomenti devono essere puntatori NULL.
Dettagli | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||
Valori restituiti |
|
otCoapSendResponse
otError otCoapSendResponse( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo )
Questa funzione invia una risposta CoAP dal server.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otCoapSendResponseBlockWise
otError otCoapSendResponseBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
Questa funzione invia una risposta CoAP in modalità di blocco dal server.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Dettagli | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||
Valori restituiti |
|
otCoapSendResponseBlockWiseWithParameters
otError otCoapSendResponseBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
Questa funzione invia dal server una risposta di blocco CoAP con parametri di trasmissione personalizzati.
Questa funzione è disponibile quando è abilitata la configurazione OPENOPEN_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
Dettagli | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||
Valori restituiti |
|
otCoapSendResponseWithParameters
otError otCoapSendResponseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters )
Questa funzione invia una risposta CoAP dal server con parametri di trasmissione personalizzati.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otCoapSetDefaultHandler
void otCoapSetDefaultHandler( otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext )
Questa funzione imposta il gestore predefinito per le richieste CoAP non gestite.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
otCoapStart
otError otCoapStart( otInstance *aInstance, uint16_t aPort )
Questa funzione avvia il server CoAP.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otCoapStop
otError otCoapStop( otInstance *aInstance )
Questa funzione arresta il server CoAP.
Dettagli | |||
---|---|---|---|
Parametri |
|
||
Valori restituiti |
|
Macro
OT_COAP_CODE
OT_COAP_CODE ((((c)&0x7) << 5) | ((d)&0x1f))
Macro helper per definire i valori del codice CoAP.
OT_COAP_DEFAULT_TOKEN_LENGTH
OT_COAP_DEFAULT_TOKEN_LENGTH 2
Lunghezza token predefinita.
OT_COAP_MAX_RETRANSMIT
OT_COAP_MAX_RETRANSMIT 20
Ritrasmissione massima supportata da OpenThread.
OT_COAP_MAX_TOKEN_LENGTH
OT_COAP_MAX_TOKEN_LENGTH 8
Lunghezza massima del token come specificato (RFC 7252).
OT_COAP_MIN_ACK_TIMEOUT
OT_COAP_MIN_ACK_TIMEOUT 1000
Timeout ACK minimo in millisecondi supportato da OpenThread.
OT_DEFAULT_COAP_PORT
OT_DEFAULT_COAP_PORT 5683
Porta CoAP predefinita, come specificato in RFC 7252.
Risorse
Gli argomenti di riferimento dell'API OpenThread provengono dal codice sorgente, disponibile su GitHub. Per ulteriori informazioni, o per contribuire alla nostra documentazione, consulta la pagina Risorse.