Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBus Doubles #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
*.node
.lock-wscript
.DS_Store

6 changes: 6 additions & 0 deletions src/node_dbus_convert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ struct v8_sink {
case DBUS_TYPE_BOOLEAN:
dst_->Set(idx_++, v8::Boolean::New(it.get<bool>()));
break;
case DBUS_TYPE_DOUBLE:
dst_->Set(idx_++, v8::Number::New(it.get<double>()));
break;
case DBUS_TYPE_INT32:
dst_->Set(idx_++, v8::Integer::New(it.get<int32_t>()));
break;
Expand Down Expand Up @@ -196,6 +199,9 @@ class dbus_sink {
} else if ((*it)->IsUint32()) {
uint32_t v = (*it)->Uint32Value();
dbus_message_iter_append_basic( & it_, DBUS_TYPE_UINT32, & v);
} else if ((*it)->IsNumber()) {
double v = (*it)->NumberValue();
dbus_message_iter_append_basic( & it_, DBUS_TYPE_DOUBLE, & v);
} else if ((*it)->IsString()) {
v8::String::Utf8Value v((*it)->ToString());
const char * str = *v;
Expand Down