You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in Gitter chat, there's no easy way in mJS to get the connected SSID or connection status, without a memory leak, or extra mJS code to get the pointer, then the value, then free afterwards.
As i'm sure others will need this in mJS -- there should be an easy way to get these values without having the memory leak or using a hack in mJS to get the value then free it.
Provided by @cpq on Gitter
one way of doing it could be something like that - FFI as a void*, not as char *
IT SHOULDN'T BE THIS DIFFICULT TO GET SSID FROM mJS!!
The text was updated successfully, but these errors were encountered:
tripflex
changed the title
Add mJS method for getting connected SSID and connection status
mgos_wifi_get_connected_ssid() causes memory leak if called in mJS
Apr 12, 2019
As mentioned in Gitter chat, there's no easy way in mJS to get the connected SSID or connection status, without a memory leak, or extra mJS code to get the pointer, then the value, then free afterwards.
As i'm sure others will need this in mJS -- there should be an easy way to get these values without having the memory leak or using a hack in mJS to get the value then free it.
Provided by @cpq on Gitter
one way of doing it could be something like that - FFI as a void*, not as char *
so the idea is that by FFI-ing void *, you get the pointer
UPDATE: The above code DOES NOT WORK CORRECTLY -- I had to add my own
strlen
with avoid *
arg to make this work:Then use:
IT SHOULDN'T BE THIS DIFFICULT TO GET SSID FROM mJS!!
The text was updated successfully, but these errors were encountered: