microCoAPy
microCoAPy copied to clipboard
OOP
I saw a method sendPacket in the code, I wanted to use it, but I had to look at the code further, it turns out this method has privacy. Do you think this is a bad method to use? :thinking:
Hello @big-vl
it is not wrong to use it as long as you provide a properly initialized CoapPacket instance as "send" and "sendEx" functions do. Also manually set the coap state:
self.state = self.TRANSMISSION_STATE.STATE_IDLE
May I ask why do you need to use the low level function directly?
Hello @big-vl
it is not wrong to use it as long as you provide a properly initialized CoapPacket instance as "send" and "sendEx" functions do. Also manually set the coap state:
self.state = self.TRANSMISSION_STATE.STATE_IDLE
May I ask why do you need to use the low level function directly?
so I wrote that it would be better to make methods more usable, for example _sendPacket
I would know that I can use it but with some limitation. So there are no problems with the code, there is also a question about subscription, as I understand it, according to the specification, such an opportunity exists but is not implemented. For now, I'll have to use sockets without a specification.
@ftylitak You have made a very stable and good library, I am delighted.
Thank you for your kind words.
Indeed, the function should be named _sendPacket
. Right now I am a bit hesitant to change it to avoid breaking compatibility with applictions that already use it...though I believe there are none to few of them.
It might be done soon.
Fo the subscription, in case you make it work, we are open for contributions :)