Skip to content

Commit

Permalink
accept also sensor broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
pa-pa committed Feb 15, 2018
1 parent e28322d commit d1dec02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class Device {
virtual bool process(__attribute__((unused)) Message& msg) { return false; }

bool isBoardcastMsg(Message msg) {
return (msg.to() == HMID::broadcast && msg.isPairSerial()) || ( msg.isBroadcast() && msg.isRemoteEvent() );
return (msg.to() == HMID::broadcast && msg.isPairSerial()) || ( msg.isBroadcast() && (msg.isRemoteEvent() || msg.isSensorEvent()) );
}

bool send(Message& msg,const HMID& to) {
Expand Down
4 changes: 4 additions & 0 deletions Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ class Message {
return typ==AS_MESSAGE_REMOTE_EVENT;
}

bool isSensorEvent () const {
return typ==AS_MESSAGE_SENSOR_EVENT;
}

// cast to specific read-only message types
const ConfigPeerAddMsg& configPeerAdd () const { return *(ConfigPeerAddMsg*)this; }
const ConfigPeerRemoveMsg& configPeerRemove () const { return *(ConfigPeerRemoveMsg*)this; }
Expand Down

0 comments on commit d1dec02

Please sign in to comment.