KNX IoT
KNX IoT Point API stack implementation
s-mode server

S-mode server side support functions. More...

Modules

 s-mode client
 S-mode Client side support functions.
 

Functions

void oc_do_s_mode_read (int64_t group_address)
 sends out an s-mode read request. More...
 
void oc_do_s_mode_with_scope (int scope, const char *resource_url, char *rp)
 sends (transmits) an s-mode message the value comes from the GET of the resource indicated by the resource_url the path is "k" the sia (sender individual address) is taken from the device the ga is coming from the group address table that is listing the resource url (path) the url of the resource to obtain the value from. More...
 
void oc_do_s_mode_with_scope_no_check (int scope, const char *resource_url, char *rp)
 sends (transmits) an s-mode message the value comes from the GET of the resource indicated by the resource_url the path is "k" the sia (sender individual address) is taken from the device the ga is coming from the group address table that is listing the resource url (path) the url of the resource to obtain the value from. More...
 
oc_s_mode_response_cb_t oc_get_s_mode_response_cb ()
 retrieve the callback function More...
 
bool oc_is_redirected_request (oc_request_t *request)
 checks if the request is a redirected request from /k or /p when that happened, extra information can be in the CBOR object More...
 
bool oc_set_s_mode_response_cb (oc_s_mode_response_cb_t my_func)
 set the s-mode response callback e.g. More...
 

Detailed Description

S-mode server side support functions.

This module contains the receiving side of the s-mode functionality. The received s-mode messages are routed to the appropriate POST methods of the data point. However since not all data is in the s-mode message the POST method needs to retrieve the data from the s-mode message differently than for an normal CoAP post message (the message payload is constructed differently).

Function Documentation

◆ oc_do_s_mode_read()

void oc_do_s_mode_read ( int64_t  group_address)

sends out an s-mode read request.

The read request has no data value

Note: function does not check the flags on the resources

See also
oc_do_s_mode_with_scope
Parameters
group_addressthe group address to invoke a read on

◆ oc_do_s_mode_with_scope()

void oc_do_s_mode_with_scope ( int  scope,
const char *  resource_url,
char *  rp 
)

sends (transmits) an s-mode message the value comes from the GET of the resource indicated by the resource_url the path is "k" the sia (sender individual address) is taken from the device the ga is coming from the group address table that is listing the resource url (path) the url of the resource to obtain the value from.

only the first group address is used to send the s-mode message for the recipient table all entries are used to send the unicast communication.

Note: function does check the T flag on the resource if the T flag is not set, then the message is NOT send.

Parameters
scopethe multi-cast scope
resource_urlURI of the resource (e.g. implemented on the device that is calling this function)
rpthe "st" value to send e.g. "w" | "rp" | "r"

◆ oc_do_s_mode_with_scope_no_check()

void oc_do_s_mode_with_scope_no_check ( int  scope,
const char *  resource_url,
char *  rp 
)

sends (transmits) an s-mode message the value comes from the GET of the resource indicated by the resource_url the path is "k" the sia (sender individual address) is taken from the device the ga is coming from the group address table that is listing the resource url (path) the url of the resource to obtain the value from.

only the first group address is used to send the s-mode message for the recipient table all entries are used to send the unicast communication.

Note: function does NOT check the T flag on the resource e.g. always send the s-mode message used in case the rp value = "rp", e.g.sending a response on read ("r")

Parameters
scopethe multi-cast scope
resource_urlURI of the resource (e.g. implemented on the device that is calling this function)
rpthe "st" value to send e.g. "w" | "rp" | "r"

◆ oc_get_s_mode_response_cb()

oc_s_mode_response_cb_t oc_get_s_mode_response_cb ( )

retrieve the callback function

Returns
oc_s_mode_response_cb_t the callback function that has been set

◆ oc_is_redirected_request()

bool oc_is_redirected_request ( oc_request_t request)

checks if the request is a redirected request from /k or /p when that happened, extra information can be in the CBOR object

Parameters
requestthe request to be checked
Returns
true
false

◆ oc_set_s_mode_response_cb()

bool oc_set_s_mode_response_cb ( oc_s_mode_response_cb_t  my_func)

set the s-mode response callback e.g.

function is called when a s-mode response is coming back

Parameters
my_functhe callback function
Returns
true function set
false function set failed