Skip to content

Commit ce66d47

Browse files
committed
Merge branch 'develop'
merge v1.1.0
2 parents a9b61bf + 9146761 commit ce66d47

File tree

56 files changed

+460
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+460
-255
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
language: python
2828
python:
29-
- "2.7"
29+
- "3.6"
3030

3131
sudo: false
3232
cache:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ An Implementation of the Ant+ Network on top of [ant-arduino](https://github.com
99

1010
## News
1111

12+
* 6/28/2020 v2.0.0 of ant-arduino released with support for mbed and softdevices
1213
* 8/20/2019 v1.0.0 released, master profiles now are available
1314
* 10/1/2017 v0.1.0 Version released, library added to managers
1415
* 9/24/2017 Proof of concept complete (for system design)

library.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
"type": "git",
88
"url": "https://github.com/cujomalainey/antplus-arduino.git"
99
},
10-
"version": "1.0.0",
11-
"frameworks": "arduino",
12-
"platforms": "atmelavr, atmelsam, espressif32, espressif8266, intel_arc32, microchippic32, nordicnrf51, nordicnrf52, ststm32, timsp430, teensy",
10+
"version": "1.1.0",
11+
"frameworks": "*",
12+
"platforms": "*",
1313
"dependencies":
1414
[
1515
{
16-
"name":"ANT"
16+
"name":"ANT",
17+
"version": ">=2.0.0"
1718
}
1819
]
1920
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ANTPLUS-Arduino
2-
version=1.0.0
2+
version=1.1.0
33
author=Curtis Malainey <[email protected]>
44
maintainer=Curtis Malainey <[email protected]>
55
sentence=Library for easy ANT+ integration

platformio.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ platform = espressif32
3535
framework = arduino
3636
board = featheresp32
3737
lib_deps = ANT
38+
39+
[env:nrf52_express]
40+
board = adafruit_feather_nrf52840_s340
41+
framework = arduino
42+
platform = nordicnrf52
43+
platform_packages = framework-arduinoadafruitnrf52 @ https://github.com/cujomalainey/Adafruit_nRF52_Arduino
44+
lib_deps = https://github.com/cujomalainey/ant-arduino.git#develop

src/BaseClasses/ANTPLUS_BaseDataPage.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class BaseDataPage : virtual public CoreDataPage<T> {
1212
#ifndef UNIT_TEST
1313
protected:
1414
#endif // UNIT_TEST
15-
uint8_t get8BitValue(uint8_t byte, uint8_t mask = 0xFF, uint8_t shift = 0);
16-
uint16_t get16BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint16_t mask = 0xFFFF, uint8_t shift = 0);
17-
uint32_t get24BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFF, uint8_t shift = 0);
18-
uint32_t get32BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFFFF, uint8_t shift = 0);
15+
uint8_t get8BitValue(uint8_t byte, uint8_t mask = 0xFF, uint8_t shift = 0) override;
16+
uint16_t get16BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint16_t mask = 0xFFFF, uint8_t shift = 0) override;
17+
uint32_t get24BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFF, uint8_t shift = 0) override;
18+
uint32_t get32BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFFFF, uint8_t shift = 0) override;
1919
};
2020

2121
#endif // ANTPLUS_BASEDATAPAGE_h

src/BaseClasses/ANTPLUS_BaseDataPageMsg.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class BaseDataPageMsg : virtual public CoreDataPage<T> {
1010
#ifndef UNIT_TEST
1111
protected:
1212
#endif // UNIT_TEST
13-
uint8_t get8BitValue(uint8_t byte, uint8_t mask = 0xFF, uint8_t shift = 0);
14-
uint16_t get16BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint16_t mask = 0xFFFF, uint8_t shift = 0);
15-
uint32_t get24BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFF, uint8_t shift = 0);
16-
uint32_t get32BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFFFF, uint8_t shift = 0);
13+
uint8_t get8BitValue(uint8_t byte, uint8_t mask = 0xFF, uint8_t shift = 0) override;
14+
uint16_t get16BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint16_t mask = 0xFFFF, uint8_t shift = 0) override;
15+
uint32_t get24BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFF, uint8_t shift = 0) override;
16+
uint32_t get32BitValue(uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFFFF, uint8_t shift = 0) override;
1717
void set8BitValue(uint8_t value, uint8_t byte, uint8_t mask = 0xFF, uint8_t shift = 0);
1818
void set16BitValue(uint16_t value, uint8_t lsb_byte, uint8_t msb_byte, uint16_t mask = 0xFFFF, uint8_t shift = 0);
1919
void set24BitValue(uint32_t value, uint8_t lsb_byte, uint8_t msb_byte, uint32_t mask = 0xFFFFFF, uint8_t shift = 0);

src/BaseClasses/ANTPLUS_BaseMasterProfile.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,17 @@ void BaseMasterProfile::begin() {
5656
// send first datapage manually so we don't transmit 0s
5757
transmitNextDataPage();
5858
}
59+
60+
void BaseMasterProfile::transmitMsg(BaseDataPageMsg<BroadcastDataMsg> &msg) {
61+
if (isRequestedPageAcknowledged() && isRequestedPagePending()) {
62+
AcknowledgedDataMsg ack;
63+
ack.setDataBuffer(msg.getDataBuffer());
64+
send(ack);
65+
} else {
66+
send(msg);
67+
}
68+
}
69+
70+
void BaseMasterProfile::transmitMsg(BaseDataPageMsg<AcknowledgedDataMsg> &msg) {
71+
send(msg);
72+
}

src/BaseClasses/ANTPLUS_BaseMasterProfile.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,29 @@
22
#define ANTPLUS_BASEMASTERPROFILE_h
33

44
#include <BaseClasses/ANTPLUS_BaseProfile.h>
5+
#include <BaseClasses/ANTPLUS_BaseDataPageMsg.h>
56

67
class BaseMasterProfile : public BaseProfile {
78
public:
89
BaseMasterProfile(uint16_t deviceNumber, uint8_t transmissionType);
910
/**
1011
* start profile transmission sequence
1112
*/
12-
virtual void begin();
13+
virtual void begin() override;
1314
protected:
1415
/**
1516
* Used to catch EVENT_TX and continue transmission pattern
1617
* Also handles EVENT_TRANSFER_TX_COMPLETED for acknowledgement
1718
*/
18-
virtual void onChannelEventResponse(ChannelEventResponse& msg);
19+
virtual void onChannelEventResponse(ChannelEventResponse& msg) override;
1920
/**
2021
* This function, when called, will transmit the next message in the broadcast pattern
2122
*/
2223
virtual void transmitNextDataPage() = 0;
2324
/**
2425
* Checks for RequestDataPage messages and handles them accordingly
2526
*/
26-
virtual void onAcknowledgedData(AcknowledgedData& msg);
27+
virtual void onAcknowledgedData(AcknowledgedData& msg) override;
2728
/**
2829
* Checks with subclass to see if request is valid
2930
*/
@@ -40,11 +41,16 @@ class BaseMasterProfile : public BaseProfile {
4041
* returns true if the request is meant to be sent as a acknowledged message
4142
*/
4243
bool isRequestedPageAcknowledged();
44+
/**
45+
* Handles ack msg conversions for requests, all transmissions that are part of the broadcast pattern should be through this.
46+
*/
47+
void transmitMsg(BaseDataPageMsg<BroadcastDataMsg> &msg);
48+
void transmitMsg(BaseDataPageMsg<AcknowledgedDataMsg> &msg);
4349
private:
4450
void handleRequestDataPage(AcknowledgedData& msg);
45-
uint8_t _requestedPage;
51+
uint8_t _requestedPage = 0;
4652
uint8_t _requestedCount = 0;
47-
bool _isRequestAcknowledged;
53+
bool _isRequestAcknowledged = false;
4854
bool _requestAcked = true;
4955
};
5056

src/BaseClasses/ANTPLUS_BaseProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void BaseProfile::checkProfileStatus() {
128128
}
129129

130130
void BaseProfile::send(AcknowledgedDataMsg& msg) {
131-
msg.setChannelNumber(_channel);
131+
msg.setChannel(_channel);
132132
_router->send(msg);
133133
}
134134

0 commit comments

Comments
 (0)