Radiocraft Wireless M-Bus extension module
1.00.00
|
These functions are called directly from the Modcall C functions. More...
Functions | |
static int | mbusClose (void) |
Closes the communication interface. More... | |
static int | mbusOpen (int8 mode, int8 rssi) |
Opens the connection to the M-Bus module. More... | |
static int | mbusSend (int16 c, int8 *data, int8 size) |
Send an M-BUS packet. More... | |
static int | mbusReceive (tdef_mbus_start_frame *start, int8 *data, int16 *rssi) |
Receive a new frame from the M-Bus module. More... | |
static int | mbus_register_slave (int idx, int16 manufacturer, int32 id, int8 version, int8 type, uint8 *key) |
Registers/installs a slave device on the M-Bus module. More... | |
static int | mbus_info (void) |
Print some information about the RF module to the device output. More... | |
These functions are called directly from the Modcall C functions.
|
static |
Print some information about the RF module to the device output.
Definition at line 1272 of file mod_mbus.c.
References mbus_read_regs(), mbusConfigCmd(), mbusConfigEnter(), mbusConfigExit(), and mbusDebug().
Referenced by mbusCallInfo().
|
static |
Registers/installs a slave device on the M-Bus module.
This is necessary when filtering or when using encryption.
[in] | idx | The index of the slave to register. 1-64. |
[in] | manufacturer | The ID of the manufacturer. Part of the device address. |
[in] | id | The device identification number/serial number. Part of the device address. |
[in] | version | The device version. Part of the device address. |
[in] | type | The device type. Part of the device address. |
[in] | key | The 16 byte (128 bit) encryption key. Can be set to NULL if encryption is not used. |
Definition at line 1222 of file mod_mbus.c.
References mbusConfigCmd(), mbusConfigEnter(), mbusConfigExit(), and mbusConfigTransact().
Referenced by mbusCallRegisterSlave().
|
static |
Closes the communication interface.
Definition at line 884 of file mod_mbus.c.
References fd, mbusDebug(), and mbusPower().
Referenced by mbusCallClose(), mbusCallInfo(), and moduleNotify().
|
static |
Opens the connection to the M-Bus module.
This must be called before the rest of the functions will work.
[in] | mode | The M-Bus mode to use.
|
[in] | rssi | Set to true to include the signal strength (RSSI) for each valid packet. It can be read from mbusReceive() and is available in the mbusFrame struct block (mbus_frame). |
Definition at line 919 of file mod_mbus.c.
References fd, mbus_config(), mbusConfigEnter(), mbusConfigExit(), mbusDebug(), and mbusPower().
Referenced by mbusCallInfo(), and mbusCallOpen().
|
static |
Receive a new frame from the M-Bus module.
[in] | start | The frame to store the information from the header in. |
[in] | data | Buffer to store the received data in. |
[out] | rssi | If not NULL and if the RSSI is included in the packet, this is set to the RSSI of the packet. |
Definition at line 1105 of file mod_mbus.c.
References fd, mbus_start_frame::length, MBUS_DATA_LENGTH, mbusDebug(), and rssi_included.
Referenced by mbusCallReceive().
|
static |
Send an M-BUS packet.
This will send a M-BUS message, if c is not -1 then the control field will be changed before sending. If no length is supplied then only the header frame will be send.
[in] | c | New value for the Control field if not -1. |
[in] | data | Data to send, may be null if only header is to be send. |
[in] | size | Size of data to send, if 0 the only header will be send |
Definition at line 1020 of file mod_mbus.c.
References fd, mbusConfigCmd(), mbusConfigEnter(), mbusConfigExit(), and mbusDebug().
Referenced by mbusCallSend().