JavaScript SPI.write output correction
Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -43,18 +43,15 @@ class Spi;
|
||||
%typemap(out) uint8_t*
|
||||
{
|
||||
%#if SWIG_V8_VERSION > 0x040000
|
||||
v8::MaybeLocal<v8::Object> objret = node::Buffer::New(v8::Isolate::GetCurrent(), (char*) $1, arg3);
|
||||
free($1);
|
||||
v8::MaybeLocal<v8::Object> objret = node::Buffer::New(v8::Isolate::GetCurrent(), (char*) result, arg3);
|
||||
if(!objret.ToLocal(&$result)) {
|
||||
SWIG_exception_fail(SWIG_ERROR, "Spi buffer failed");
|
||||
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
||||
}
|
||||
%#elif SWIG_V8_VERSION > 0x032870
|
||||
$result = node::Buffer::New((char*) $1, arg3);
|
||||
free($1);
|
||||
$result = node::Buffer::New((char*) result, arg3);
|
||||
%#else
|
||||
$result = node::Buffer::New((char*) $1, arg3)->handle_;
|
||||
free($1);
|
||||
$result = node::Buffer::New((char*) result, arg3)->handle_;
|
||||
%#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user