KNX IoT
KNX IoT Point API stack implementation
IOT_ROUTER

Optional group of iot_router functions. More...

Data Structures

struct  oc_gateway_t
 The gateway info. More...
 
struct  oc_group_mapping_table_t
 Group Mapping Table Resource (/fp/gm) The payload is an array of objects. More...
 

Typedefs

typedef void(* oc_gateway_s_mode_cb_t) (size_t device_index, char *sender_ip_address, oc_group_object_notification_t *s_mode_message, void *data)
 Callback invoked for all s-mode communication e.g. More...
 
typedef struct oc_gateway_t oc_gateway_t
 The gateway info. More...
 
typedef struct oc_group_mapping_table_t oc_group_mapping_table_t
 Group Mapping Table Resource (/fp/gm) The payload is an array of objects. More...
 

Functions

void oc_core_f_netip_get_handler (oc_request_t *request, oc_interface_mask_t iface_mask, void *data)
 
int oc_core_get_group_mapping_table_size ()
 returns the size (amount of total entries) of the fp / gm table More...
 
int oc_core_set_group_mapping_table (size_t device_index, int index, oc_group_mapping_table_t entry, bool store)
 set an entry in the group mapping table More...
 
void oc_create_iot_router_functional_block (size_t device_index)
 
void oc_create_knx_iot_router_resources (size_t device_index)
 Creation of the knx iot router resources. More...
 
void oc_delete_group_mapping_table ()
 delete all entries of the Group Mapping Table (from persistent) storage More...
 
int oc_get_f_netip_fra (size_t device_index)
 retrieve the IPv4 sync latency fraction (fra). More...
 
oc_string_t oc_get_f_netip_key (size_t device_index)
 retrieve the IPv4 routing backbone key More...
 
uint32_t oc_get_f_netip_mcast (size_t device_index)
 retrieve the current IPv4 routing multicast address. More...
 
int oc_get_f_netip_tol (size_t device_index)
 retrieve the IPv4 routing latency tolerance (tol) More...
 
int oc_get_f_netip_ttl (size_t device_index)
 retrieve the value defines how many routers a multicast message MAY pass until it gets discarded. More...
 
oc_gateway_toc_get_gateway_cb (void)
 retrieve the gateway info, e.g. More...
 
oc_group_mapping_table_toc_get_group_mapping_entry (size_t device_index, int index)
 retrieve group mapping entry More...
 
void oc_load_group_mapping_table ()
 load all entries of the Group Mapping Table (from persistent) storage More...
 
int oc_set_gateway_cb (oc_gateway_s_mode_cb_t oc_gateway_s_mode_cb_t, void *data)
 Initialize the gateway callbacks. More...
 

Detailed Description

Optional group of iot_router functions.

Currently implemented:

Typedef Documentation

◆ oc_gateway_s_mode_cb_t

typedef void(* oc_gateway_s_mode_cb_t) (size_t device_index, char *sender_ip_address, oc_group_object_notification_t *s_mode_message, void *data)

Callback invoked for all s-mode communication e.g.

to be used to create a KNX-IOT to CLASSIC gateway

Definition at line 207 of file oc_knx_gm.h.

◆ oc_gateway_t

typedef struct oc_gateway_t oc_gateway_t

The gateway info.

◆ oc_group_mapping_table_t

Group Mapping Table Resource (/fp/gm) The payload is an array of objects.

Example (JSON):

[
{
"id": "1",
"ga":[2305, 2401],
"dataType" : 1
},
{
"id": 2,
"ga": [2306],
"dataType": 5,
"s": {
"groupkey": "<key>"
"secSettings": {
"a": true,
"c": true
}
}
}
]

Key translation

Json Key Integer Value
id 0
ga 7
dataType 116 (t)
s 115 (s)
groupKey 107
secSettings 28
a 97 (a)
c 99 (c)

The structure stores the information. The structure will be used as an array. There are function to find

  • empty index in the array
  • find the index with a specific id
  • delete an index, e.g. delete the array entry of data (persistent)
  • make the entry persistent
  • free the data

Function Documentation

◆ oc_core_get_group_mapping_table_size()

int oc_core_get_group_mapping_table_size ( )

returns the size (amount of total entries) of the fp / gm table

Returns
the allocated amount of entries of the group mapping at table

◆ oc_core_set_group_mapping_table()

int oc_core_set_group_mapping_table ( size_t  device_index,
int  index,
oc_group_mapping_table_t  entry,
bool  store 
)

set an entry in the group mapping table

Note: does not write to persistent storage

Parameters
device_indexindex of the device
indexthe index in the table, will overwrite if something is there
entrythe group mapping entry
storethe store the entry to persistent storage
Returns
int 0 == successful

◆ oc_create_knx_iot_router_resources()

void oc_create_knx_iot_router_resources ( size_t  device_index)

Creation of the knx iot router resources.

Parameters
device_indexindex of the device to which the resource are to be created

◆ oc_delete_group_mapping_table()

void oc_delete_group_mapping_table ( )

delete all entries of the Group Mapping Table (from persistent) storage

◆ oc_get_f_netip_fra()

int oc_get_f_netip_fra ( size_t  device_index)

retrieve the IPv4 sync latency fraction (fra).

Parameters
device_indexindex of the device
Returns
the fra value

◆ oc_get_f_netip_key()

oc_string_t oc_get_f_netip_key ( size_t  device_index)

retrieve the IPv4 routing backbone key

Parameters
device_indexindex of the device
Returns
the key value

◆ oc_get_f_netip_mcast()

uint32_t oc_get_f_netip_mcast ( size_t  device_index)

retrieve the current IPv4 routing multicast address.

(mcast)

Parameters
device_indexindex of the device
Returns
the mcast value

◆ oc_get_f_netip_tol()

int oc_get_f_netip_tol ( size_t  device_index)

retrieve the IPv4 routing latency tolerance (tol)

Parameters
device_indexindex of the device
Returns
the tol value

◆ oc_get_f_netip_ttl()

int oc_get_f_netip_ttl ( size_t  device_index)

retrieve the value defines how many routers a multicast message MAY pass until it gets discarded.

(ttl)

Parameters
device_indexindex of the device
Returns
the ttl value

◆ oc_get_gateway_cb()

oc_gateway_t* oc_get_gateway_cb ( void  )

retrieve the gateway info, e.g.

the callback and callback data

Returns
oc_gateway_t* the s-mode gateway data

◆ oc_get_group_mapping_entry()

oc_group_mapping_table_t* oc_get_group_mapping_entry ( size_t  device_index,
int  index 
)

retrieve group mapping entry

Parameters
device_indexthe device index
indexthe index in the table
Returns
oc_group_mapping_table_t* the group mapping entry

◆ oc_load_group_mapping_table()

void oc_load_group_mapping_table ( )

load all entries of the Group Mapping Table (from persistent) storage

◆ oc_set_gateway_cb()

int oc_set_gateway_cb ( oc_gateway_s_mode_cb_t  oc_gateway_s_mode_cb_t,
void *  data 
)

Initialize the gateway callbacks.

This function is typically called as part of an KNX-IOT to Classic gateway

Parameters
[in]oc_gateway_s_mode_cb_tcallback function invoked for each received s-mode message.
[in]datacontext pointer that is passed to the oc_gateway_s_mode_cb_t
Returns
  • 0 on success
  • -1 on failure
See also
init
oc_gateway_s_mode_cb_t