I have experimented on your ESP32 Iotivity-constrained port and the 
implementation runs flawless for me, am actually setting up a WSN using ESP32 
and Atmega based device at present Arduino Mega!
Thus, wish to port Iotivity-constrained to Arduino starting at Mega using the 
w5500 chip. Am starting with the connectivity part of the port as it seems the 
most confusing for me right now. Looking at the “oc_connectivity.h” file one 
need to implement the functions below:

int oc_connectivity_init(void);
void oc_connectivity_shutdown(void);
void oc_send_buffer(oc_message_t *message);
void oc_send_discovery_request(oc_message_t *message);
I needed some guidance on implementing those methods:

Question 1:
 My basic understanding it that one need to open two UDP sockets providing 
address and ports (in this method int oc_connectivity_init(void)) to start 
listening for multicast and send uni-cast payloads? Except from the socket ids, 
uni-cast port, multicast port and address, are there other variable I should 
handle?

Question 2:
The “oc_connectivity_shutdown” shall close these ports (either IPV6 or IPV4) , 
release memory assign for the communication(port, address, socket...)?

Question 3
I do understand from other ports what happen in send buffer and send 
discovery(at least the main idea). Although, where do both function get 
"oc_message_t *message" from? Is it from the iotivity-constrained core? should 
the user catch network event (in the arduino case receive buffer containing 
data event) and construct the oc_message_object? i have seen a  mention 
something about oc_network_event() to register the message to the framework. 
Thus: for a server, I can listen for an event on the receive buffer and 
construct the message passing to the framework using oc_network_event()? does 
this call need to be protected? when does the core actually call this function? 
do i need to synchronize my access to  " oc_network_event()"? 

Question 4:
oc_send_buffer is used mainly for discovery request? as i only see calls to it 
inside oc_send_discovery_request in this case does the framework build the 
message itself? which i assume
Regards!

Yann

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10049): 
https://lists.iotivity.org/g/iotivity-dev/message/10049
Mute This Topic: https://lists.iotivity.org/mt/28636386/21656
Group Owner: iotivity-dev+ow...@lists.iotivity.org
Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to