Skip to content

Commit a4bb150

Browse files
committed
Deprecated "dataNum" replaced with "dataSize".
#7
1 parent 05cba6d commit a4bb150

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ vscp.prepareTxMessage(txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_ON
5050
### Add the class and type specific data.
5151

5252
```
53-
txMsg.data[0] = 1; // Index
54-
txMsg.data[1] = 0; // Zone
55-
txMsg.data[2] = 0; // Sub zone
56-
txMsg.dataNum = 3;
53+
txMsg.data[0] = 1; // Index
54+
txMsg.data[1] = 0; // Zone
55+
txMsg.data[2] = 0; // Sub zone
56+
txMsg.dataSize = 3;
5757
```
5858

5959
### Send the event.

examples/Generic/Generic.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ bool transportRead(vscp_RxMessage * const rxMsg) {
4646
rxMsg->vscpType = ...
4747
rxMsg->oAddr = ...
4848
rxMsg->hardCoded = ...
49-
rxMsg->dataNum = ...
49+
rxMsg->dataSize = ...
5050
5151
// Protect against data buffer out of bounce access
52-
if (VSCP_L1_DATA_SIZE < rxMsg->dataNum)
52+
if (VSCP_L1_DATA_SIZE < rxMsg->dataSize)
5353
{
54-
rxMsg->dataNum = VSCP_L1_DATA_SIZE;
54+
rxMsg->dataSize = VSCP_L1_DATA_SIZE;
5555
}
5656
5757
// Copy the payload
58-
for(index = 0; index < rxMsg->dataNum; ++index)
58+
for(index = 0; index < rxMsg->dataSize; ++index)
5959
{
6060
rxMsg->data[index] = ...
6161
}
@@ -79,10 +79,10 @@ bool transportWrite(vscp_TxMessage const * const txMsg) {
7979
... = rxMsg->vscpType;
8080
... = rxMsg->oAddr;
8181
... = rxMsg->hardCoded;
82-
... = rxMsg->dataNum;
82+
... = rxMsg->dataSize;
8383
8484
// Copy the payload
85-
for(index = 0; index < rxMsg->dataNum; ++index)
85+
for(index = 0; index < rxMsg->dataSize; ++index)
8686
{
8787
... = rxMsg->data[index];
8888
}
@@ -163,10 +163,10 @@ void loop() {
163163

164164
// Send a VSCP message here ... e.g. a CLASS1.INFORMATION ON event
165165
vscp.prepareTxMessage(txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_ON, VSCP_PRIORITY_3_NORMAL);
166-
txMsg.data[0] = 1; // Index
167-
txMsg.data[1] = 0; // Zone
168-
txMsg.data[2] = 0; // Sub zone
169-
txMsg.dataNum = 3;
166+
txMsg.data[0] = 1; // Index
167+
txMsg.data[1] = 0; // Zone
168+
txMsg.data[2] = 0; // Sub zone
169+
txMsg.dataSize = 3;
170170
vscp.write(txMsg);
171171

172172
} else {

examples/Seeed-Studio-CAN_BUS_Shield/Seeed-Studio-CAN_BUS_Shield.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool transportRead(vscp_RxMessage * const rxMsg) {
5050
{
5151
unsigned long canMsgId = 0;
5252

53-
if (CAN_OK == canCom.readMsgBufID(&canMsgId, &rxMsg->dataNum, rxMsg->data)) {
53+
if (CAN_OK == canCom.readMsgBufID(&canMsgId, &rxMsg->dataSize, rxMsg->data)) {
5454

5555
rxMsg->vscpClass = (uint16_t)((canMsgId >> 16) & 0x01ff);
5656
rxMsg->vscpType = (uint8_t)((canMsgId >> 8) & 0x00ff);
@@ -88,7 +88,7 @@ bool transportWrite(vscp_TxMessage const * const txMsg) {
8888
}
8989

9090
// Send CAN message
91-
if (CAN_OK != canCom.sendMsgBuf(canMsgId, 1, 0, txMsg->dataNum, (unsigned char*)txMsg->data)) {
91+
if (CAN_OK != canCom.sendMsgBuf(canMsgId, 1, 0, txMsg->dataSize, (unsigned char*)txMsg->data)) {
9292

9393
// CAN message couldn't be sent, try again.
9494
++retryCnt;
@@ -225,4 +225,4 @@ void loop() {
225225

226226
}
227227

228-
}
228+
}

examples/Sparkfun_CAN-BUS_Shield/Sparkfun_CAN-BUS_Shield.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ bool transportRead(vscp_RxMessage * const rxMsg) {
5454
rxMsg->oAddr = (uint8_t)((canMsg.adrsValue >> 0) & 0x00ff);
5555
rxMsg->hardCoded = (uint8_t)((canMsg.adrsValue >> 25) & 0x0001);
5656
rxMsg->priority = (VSCP_PRIORITY)((canMsg.adrsValue >> 26) & 0x0007);
57-
rxMsg->dataNum = canMsg.dataLength;
57+
rxMsg->dataSize = canMsg.dataLength;
5858

5959
// Protect against a buffer out of bounce access
60-
if (VSCP_L1_DATA_SIZE < rxMsg->dataNum) {
60+
if (VSCP_L1_DATA_SIZE < rxMsg->dataSize) {
6161

62-
rxMsg->dataNum = VSCP_L1_DATA_SIZE;
62+
rxMsg->dataSize = VSCP_L1_DATA_SIZE;
6363
}
6464

6565
// Copy payload
66-
for(index = 0; index < rxMsg->dataNum; ++index) {
66+
for(index = 0; index < rxMsg->dataSize; ++index) {
6767

6868
rxMsg->data[index] = canMsg.data[index];
6969
}
@@ -94,7 +94,7 @@ bool transportWrite(vscp_TxMessage const * const txMsg) {
9494

9595
canMsg.rtr = 0;
9696

97-
canMsg.dataLength = txMsg->dataNum;
97+
canMsg.dataLength = txMsg->dataSize;
9898

9999
for(index = 0; index < canMsg.dataLength; ++index) {
100100

@@ -242,4 +242,4 @@ void loop() {
242242

243243
}
244244

245-
}
245+
}

src/framework/user/vscp_tp_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ extern BOOL vscp_tp_adapter_writeMessage(vscp_TxMessage const * const msg)
140140
BOOL status = FALSE;
141141

142142
if ((NULL != msg) && /* Message shall exists */
143-
(VSCP_L1_DATA_SIZE >= msg->dataNum)) /* Number of data bytes is limited */
143+
(VSCP_L1_DATA_SIZE >= msg->dataSize)) /* Number of data bytes is limited */
144144
{
145145
if (NULL != vscp_tp_adapter_writeFunc)
146146
{

0 commit comments

Comments
 (0)