How to access the data in javascript from the ctype pointer of type uint8_t
I am having some data in ctype uint8_t type pointer which I want to read into the var array in javascript.
I have done simple for loop to copy the data,
for(var j = 0x00; j < 5; j ++) {
var dataReceived[j] = ptr[j];
}
but when tried to display data in alert window, it is showing "undefined".
Can anybody help me to copy data from ctype uint8_t pointer to var array?
Is 开发者_运维技巧there any mechanism to copy data?
Vishal N
I've found that [contents] property of a pointer ctypes object can be used to access the object it points to.
try this:
for(var j = 0x00; j < 5; j ++) {
var dataReceived[j] = ptr[j].contents;
}
精彩评论