-
Notifications
You must be signed in to change notification settings - Fork 101
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
50 additions
and
46 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
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
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,28 @@ | ||
#include "dpt17.h" | ||
|
||
#include "dptconvert.h" | ||
|
||
|
||
Knx::Go_SizeCode Knx::DPT_SceneNumber::size() const | ||
{ | ||
return Go_1_Octet; | ||
} | ||
|
||
void Knx::DPT_SceneNumber::encode(uint8_t* data) const | ||
{ | ||
unsigned8ToPayload(data, 0, _value, 0xFF); | ||
} | ||
|
||
bool Knx::DPT_SceneNumber::decode(uint8_t* data) | ||
{ | ||
_value = unsigned8FromPayload(data, 0) & 0x3F; | ||
return true; | ||
} | ||
|
||
void Knx::DPT_SceneNumber::value(uint8_t value) | ||
{ | ||
if ( value > 63) | ||
return; | ||
|
||
_value = value; | ||
} |
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,18 @@ | ||
#pragma once | ||
#include "dpt.h" | ||
namespace Knx | ||
{ | ||
class DPT_SceneNumber: public ValueDpt<uint8_t> | ||
{ | ||
enum ReadDirectionValue { LeftToRight = 0, RightToLeft = 1}; | ||
public: | ||
DPT_SceneNumber(); | ||
DPT_SceneNumber(const char* value); | ||
Go_SizeCode size() const override; | ||
|
||
void encode(uint8_t* data) const override; | ||
bool decode(uint8_t* data) override; | ||
|
||
void value(uint8_t value) override; | ||
}; | ||
} |
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
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
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