Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
456 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* This file is part of smarthomatic, http://www.smarthomatic.org. | ||
* Copyright (c) 2013 Uwe Freese | ||
* | ||
* smarthomatic is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* smarthomatic is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with smarthomatic. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! WARNING: This file is generated by the SHC EEPROM editor and should ! | ||
* ! never be modified manually. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
#include "packet_header.h" | ||
#include "packet_headerext_ackstatus.h" | ||
#include "packet_headerext_ack.h" | ||
#include "packet_headerext_status.h" | ||
#include "packet_headerext_setget.h" | ||
#include "packet_headerext_set.h" | ||
#include "packet_headerext_get.h" | ||
#include "e2p_access.h" | ||
|
||
// Message Group "powerswitch" | ||
// =========================== | ||
// MessageGroupID: 20 | ||
|
||
|
||
// Message "powerswitch_switchstate" | ||
// --------------------------------- | ||
// MessageGroupID: 20 | ||
// MessageID: 1 | ||
// Possible MessageTypes: Get, Set, SetGet, Status, Ack, AckStatus | ||
// Validity: test | ||
// Length w/o Header + HeaderExtension: 17 bits | ||
// Data fields: On, TimeoutSec | ||
// Description: | ||
|
||
// Function to initialize header for the MessageType "Get". | ||
static inline void pkg_header_init_powerswitch_switchstate_get(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(0); | ||
pkg_headerext_get_set_messagegroupid(20); | ||
pkg_headerext_get_set_messageid(1); | ||
__HEADEROFFSETBITS = 95; | ||
__PACKETSIZEBYTES = 16; | ||
} | ||
|
||
// Function to initialize header for the MessageType "Set". | ||
static inline void pkg_header_init_powerswitch_switchstate_set(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(1); | ||
pkg_headerext_set_set_messagegroupid(20); | ||
pkg_headerext_set_set_messageid(1); | ||
__HEADEROFFSETBITS = 95; | ||
__PACKETSIZEBYTES = 16; | ||
} | ||
|
||
// Function to initialize header for the MessageType "SetGet". | ||
static inline void pkg_header_init_powerswitch_switchstate_setget(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(2); | ||
pkg_headerext_setget_set_messagegroupid(20); | ||
pkg_headerext_setget_set_messageid(1); | ||
__HEADEROFFSETBITS = 95; | ||
__PACKETSIZEBYTES = 16; | ||
} | ||
|
||
// Function to initialize header for the MessageType "Status". | ||
static inline void pkg_header_init_powerswitch_switchstate_status(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(8); | ||
pkg_headerext_status_set_messagegroupid(20); | ||
pkg_headerext_status_set_messageid(1); | ||
__HEADEROFFSETBITS = 83; | ||
__PACKETSIZEBYTES = 16; | ||
} | ||
|
||
// Function to initialize header for the MessageType "Ack". | ||
static inline void pkg_header_init_powerswitch_switchstate_ack(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(9); | ||
__HEADEROFFSETBITS = 109; | ||
__PACKETSIZEBYTES = 16; | ||
} | ||
|
||
// Function to initialize header for the MessageType "AckStatus". | ||
static inline void pkg_header_init_powerswitch_switchstate_ackstatus(void) | ||
{ | ||
memset(&bufx[0], 0, sizeof(bufx)); | ||
pkg_header_set_messagetype(10); | ||
pkg_headerext_ackstatus_set_messagegroupid(20); | ||
pkg_headerext_ackstatus_set_messageid(1); | ||
__HEADEROFFSETBITS = 120; | ||
__PACKETSIZEBYTES = 32; | ||
} | ||
|
||
// Set On (BoolValue) | ||
// Offset: ((uint16_t)__HEADEROFFSETBITS + 0) / 8, ((uint16_t)__HEADEROFFSETBITS + 0) % 8, length bytes 1 | ||
static inline void msg_powerswitch_switchstate_set_on(uint8_t val) | ||
{ | ||
array_write_UIntValue(((uint16_t)__HEADEROFFSETBITS + 0) / 8, ((uint16_t)__HEADEROFFSETBITS + 0) % 8, 1, val, bufx); | ||
} | ||
|
||
// Set TimeoutSec (UIntValue) | ||
// Offset: ((uint16_t)__HEADEROFFSETBITS + 1) / 8, ((uint16_t)__HEADEROFFSETBITS + 1) % 8, length bits 16, min val 0, max val 65535 | ||
static inline void msg_powerswitch_switchstate_set_timeoutsec(uint32_t val) | ||
{ | ||
array_write_UIntValue(((uint16_t)__HEADEROFFSETBITS + 1) / 8, ((uint16_t)__HEADEROFFSETBITS + 1) % 8, 16, val, bufx); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of smarthomatic, http://www.smarthomatic.org. | ||
* Copyright (c) 2013 Uwe Freese | ||
* | ||
* smarthomatic is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* smarthomatic is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with smarthomatic. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! WARNING: This file is generated by the SHC EEPROM editor and should ! | ||
* ! never be modified manually. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
#ifndef _PACKET_HEADEREXT_ACK_H | ||
#define _PACKET_HEADEREXT_ACK_H | ||
|
||
#include "packet_header.h" | ||
|
||
// Set AckSenderID (UIntValue) | ||
// Offset: 9, 0, length bits 12, min val 0, max val 4095 | ||
static inline void pkg_headerext_ack_set_acksenderid(uint32_t val) | ||
{ | ||
array_write_UIntValue(9, 0, 12, val, bufx); | ||
} | ||
|
||
// Set AckPacketCounter (UIntValue) | ||
// Offset: 10, 4, length bits 24, min val 0, max val 16777215 | ||
static inline void pkg_headerext_ack_set_ackpacketcounter(uint32_t val) | ||
{ | ||
array_write_UIntValue(10, 4, 24, val, bufx); | ||
} | ||
|
||
// Set Error (BoolValue) | ||
// Offset: 13, 4, length bytes 1 | ||
static inline void pkg_headerext_ack_set_error(uint8_t val) | ||
{ | ||
array_write_UIntValue(13, 4, 1, val, bufx); | ||
} | ||
|
||
|
||
// overall length: 109 bits | ||
// message data follows: no | ||
|
||
#endif /* _PACKET_HEADEREXT_ACK_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* This file is part of smarthomatic, http://www.smarthomatic.org. | ||
* Copyright (c) 2013 Uwe Freese | ||
* | ||
* smarthomatic is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* smarthomatic is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with smarthomatic. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! WARNING: This file is generated by the SHC EEPROM editor and should ! | ||
* ! never be modified manually. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
#ifndef _PACKET_HEADEREXT_ACKSTATUS_H | ||
#define _PACKET_HEADEREXT_ACKSTATUS_H | ||
|
||
#include "packet_header.h" | ||
|
||
// Set AckSenderID (UIntValue) | ||
// Offset: 9, 0, length bits 12, min val 0, max val 4095 | ||
static inline void pkg_headerext_ackstatus_set_acksenderid(uint32_t val) | ||
{ | ||
array_write_UIntValue(9, 0, 12, val, bufx); | ||
} | ||
|
||
// Set AckPacketCounter (UIntValue) | ||
// Offset: 10, 4, length bits 24, min val 0, max val 16777215 | ||
static inline void pkg_headerext_ackstatus_set_ackpacketcounter(uint32_t val) | ||
{ | ||
array_write_UIntValue(10, 4, 24, val, bufx); | ||
} | ||
|
||
// Set Error (BoolValue) | ||
// Offset: 13, 4, length bytes 1 | ||
static inline void pkg_headerext_ackstatus_set_error(uint8_t val) | ||
{ | ||
array_write_UIntValue(13, 4, 1, val, bufx); | ||
} | ||
|
||
// Set MessageGroupID (UIntValue) | ||
// Offset: 13, 5, length bits 7, min val 0, max val 127 | ||
static inline void pkg_headerext_ackstatus_set_messagegroupid(uint32_t val) | ||
{ | ||
array_write_UIntValue(13, 5, 7, val, bufx); | ||
} | ||
|
||
// Set MessageID (UIntValue) | ||
// Offset: 14, 4, length bits 4, min val 0, max val 15 | ||
static inline void pkg_headerext_ackstatus_set_messageid(uint32_t val) | ||
{ | ||
array_write_UIntValue(14, 4, 4, val, bufx); | ||
} | ||
|
||
|
||
// overall length: 120 bits | ||
// message data follows: yes | ||
|
||
#endif /* _PACKET_HEADEREXT_ACKSTATUS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of smarthomatic, http://www.smarthomatic.org. | ||
* Copyright (c) 2013 Uwe Freese | ||
* | ||
* smarthomatic is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* smarthomatic is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with smarthomatic. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! WARNING: This file is generated by the SHC EEPROM editor and should ! | ||
* ! never be modified manually. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
#ifndef _PACKET_HEADEREXT_GET_H | ||
#define _PACKET_HEADEREXT_GET_H | ||
|
||
#include "packet_header.h" | ||
|
||
// Set ReceiverID (UIntValue) | ||
// Offset: 9, 0, length bits 12, min val 0, max val 4095 | ||
static inline void pkg_headerext_get_set_receiverid(uint32_t val) | ||
{ | ||
array_write_UIntValue(9, 0, 12, val, bufx); | ||
} | ||
|
||
// Set MessageGroupID (UIntValue) | ||
// Offset: 10, 4, length bits 7, min val 0, max val 127 | ||
static inline void pkg_headerext_get_set_messagegroupid(uint32_t val) | ||
{ | ||
array_write_UIntValue(10, 4, 7, val, bufx); | ||
} | ||
|
||
// Set MessageID (UIntValue) | ||
// Offset: 11, 3, length bits 4, min val 0, max val 15 | ||
static inline void pkg_headerext_get_set_messageid(uint32_t val) | ||
{ | ||
array_write_UIntValue(11, 3, 4, val, bufx); | ||
} | ||
|
||
|
||
// overall length: 95 bits | ||
// message data follows: no | ||
|
||
#endif /* _PACKET_HEADEREXT_GET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of smarthomatic, http://www.smarthomatic.org. | ||
* Copyright (c) 2013 Uwe Freese | ||
* | ||
* smarthomatic is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* smarthomatic is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with smarthomatic. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! WARNING: This file is generated by the SHC EEPROM editor and should ! | ||
* ! never be modified manually. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
#ifndef _PACKET_HEADEREXT_SET_H | ||
#define _PACKET_HEADEREXT_SET_H | ||
|
||
#include "packet_header.h" | ||
|
||
// Set ReceiverID (UIntValue) | ||
// Offset: 9, 0, length bits 12, min val 0, max val 4095 | ||
static inline void pkg_headerext_set_set_receiverid(uint32_t val) | ||
{ | ||
array_write_UIntValue(9, 0, 12, val, bufx); | ||
} | ||
|
||
// Set MessageGroupID (UIntValue) | ||
// Offset: 10, 4, length bits 7, min val 0, max val 127 | ||
static inline void pkg_headerext_set_set_messagegroupid(uint32_t val) | ||
{ | ||
array_write_UIntValue(10, 4, 7, val, bufx); | ||
} | ||
|
||
// Set MessageID (UIntValue) | ||
// Offset: 11, 3, length bits 4, min val 0, max val 15 | ||
static inline void pkg_headerext_set_set_messageid(uint32_t val) | ||
{ | ||
array_write_UIntValue(11, 3, 4, val, bufx); | ||
} | ||
|
||
|
||
// overall length: 95 bits | ||
// message data follows: yes | ||
|
||
#endif /* _PACKET_HEADEREXT_SET_H */ |
Oops, something went wrong.