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

Expose a function that allows to send raw data on the network interface. #158

Open
wants to merge 2 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
22 changes: 22 additions & 0 deletions src-lib/libopenzwave/libopenzwave.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4950,3 +4950,25 @@ sceneGetValues_

'''
return self.manager.ActivateScene(sceneid)

def sendRawData(self, homeId, nodeId, logText, msgType, sendSecure, content):
'''
.. _sendRawData:

Send a custom message to a node.

:param homeId: The ID of the network.
:type homeId: int
:param nodeId: The ID of the target node.
:type nodeId: int
:param logText: The text to prefix the resulting log message.
:type logText: str
:param msgType: The type of the message.
:type msgType: int
:param sendSecure: Indicates whether the packet should be encrypted (if the CC accepts it).
:type sendSecure: bool
:param content: The message content.
:type content: bytes
'''
return self.manager.SendRawData(homeId, nodeId, logText, msgType, sendSecure, content, len(content))

1 change: 1 addition & 0 deletions src-lib/libopenzwave/manager.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ cdef extern from "Manager.h" namespace "OpenZWave":
void SetSceneLabel( uint8_t sceneId, string value )
bool SceneExists( uint8_t sceneId )
bool ActivateScene( uint8_t sceneId )
void SendRawData( uint32_t _homeId, uint8_t _nodeId, string _logText, uint8_t _msgType, bool _sendSecure, uint8_t* _content, uint8_t _length )

cdef extern from "Manager.h" namespace "OpenZWave::Manager":
Manager* Create()
Expand Down