-
-
-
-
const typeStore = { b2_uint16_1p: arr => { let dv = new DataView(new Uint8Array(arr).buffer); let decim = dv.getUint16(0); return (decim / 10).toFixed(1); }, b4_float32_: arr2 => { let dv = new DataView(new Uint8Array(arr2).buffer); let decim = dv.getFloat32(0); return decim; }, }
I invoke method like this:
inter.prototype.interpret = function (dataTypeString, dataArr) { return typeStore[dataTypeString](dataArr); };
let md=new Md; md.interpret[b4_float32_](99)
{ VERSION: "2v04.332", GIT_COMMIT: "57da2618", BOARD: "STM32F4DISCOVERY", FLASH: 1048576, RAM: 196608, SERIAL: "32005a00-0c513832-36393630", CONSOLE: "USB", MODULES: "Flash,Storage,hea" ... "S,WIZnet,neopixel", EXPTR: 536871244 }
I can't invoke the second method, in this position, I just can only use the first method, the others just return UNDEFINED。
-
When I use Ethernet, I plug cable, I want to get the state of SPI so that I can judge if I need to getIP() from network. Oppositely, when I unplug the cable, when I invoke code like 'eth.getIP()', system shown that I could connect to the internet, but actually it couldn't.
So, how do I easily get the collectors states?
If a borad have both Ethernet and GPRS, how to automatically join network? How to handle the ip method?
-
I used a lora for sending datas constantly, and I recieved datas in espruion.
I recieve data like this:
lora.on('data', function (data) { console.log(data); });
but I can't get the whole datas, just one character。
I send 'abcccc',
but console.log always print a,b,c,c,c,c one by one.
How do I get the whole data?
I run a example in STM32F4DISCOVERY board.
It's about Storage.
I copy codes into right-side IDE like this:
then I send and save into board.
But it make error like this
What's wrong with it?