Skip to content

Commit 659eb9c

Browse files
committed
rename ConfiguratorAgent poll method into update
1 parent edf8ba9 commit 659eb9c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/ConfiguratorAgents/AgentsManager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ AgentsManagerStates AgentsManagerClass::handleInit() {
197197
AgentsManagerStates nextState = _state;
198198

199199
for (std::list<ConfiguratorAgent *>::iterator agent = _agentsList.begin(); agent != _agentsList.end(); ++agent) {
200-
if ((*agent)->poll() == ConfiguratorAgent::AgentConfiguratorStates::PEER_CONNECTED) {
200+
if ((*agent)->update() == ConfiguratorAgent::AgentConfiguratorStates::PEER_CONNECTED) {
201201
_selectedAgent = *agent;
202202
nextState = AgentsManagerStates::SEND_INITIAL_STATUS;
203203
break;
@@ -240,7 +240,7 @@ AgentsManagerStates AgentsManagerClass::handleConfInProgress() {
240240
return AgentsManagerStates::INIT;
241241
}
242242

243-
ConfiguratorAgent::AgentConfiguratorStates agentConfState = _selectedAgent->poll();
243+
ConfiguratorAgent::AgentConfiguratorStates agentConfState = _selectedAgent->update();
244244
switch (agentConfState) {
245245
case ConfiguratorAgent::AgentConfiguratorStates::RECEIVED_DATA: handleReceivedData (); break;
246246
case ConfiguratorAgent::AgentConfiguratorStates::INIT: handlePeerDisconnected(); return AgentsManagerStates::INIT;

src/ConfiguratorAgents/agents/BLE/BLEAgent.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class BLEAgentClass : public ConfiguratorAgent, BoardConfigurationProtocol {
5050
BLEAgentClass();
5151
AgentConfiguratorStates begin();
5252
AgentConfiguratorStates end();
53-
AgentConfiguratorStates poll();
53+
AgentConfiguratorStates update();
5454
void disconnectPeer();
5555
bool receivedMsgAvailable();
5656
bool getReceivedMsg(ProvisioningInputMessage &msg);
@@ -152,7 +152,7 @@ inline ConfiguratorAgent::AgentConfiguratorStates BLEAgentClass::end() {
152152
return _state;
153153
}
154154

155-
inline ConfiguratorAgent::AgentConfiguratorStates BLEAgentClass::poll() {
155+
inline ConfiguratorAgent::AgentConfiguratorStates BLEAgentClass::update() {
156156
if (_state == AgentConfiguratorStates::END) {
157157
return _state;
158158
}

src/ConfiguratorAgents/agents/ConfiguratorAgent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ConfiguratorAgent {
2525
virtual ~ConfiguratorAgent() {}
2626
virtual AgentConfiguratorStates begin() = 0;
2727
virtual AgentConfiguratorStates end() = 0;
28-
virtual AgentConfiguratorStates poll() = 0;
28+
virtual AgentConfiguratorStates update() = 0;
2929
virtual void disconnectPeer() = 0;
3030
virtual bool receivedMsgAvailable() = 0;
3131
virtual bool getReceivedMsg(ProvisioningInputMessage &msg) = 0;

src/ConfiguratorAgents/agents/Serial/SerialAgent.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
#include "ConfiguratorAgents/agents/BoardConfigurationProtocol/cbor/CBORInstances.h"
1515
#include "Utility/LEDFeedback/LEDFeedback.h"
1616

17-
class SerialAgentClass : public ConfiguratorAgent, BoardConfigurationProtocol {
17+
class SerialAgentClass : public ConfiguratorAgent, BoardConfigurationProtocol { //TODO put private BoardConfigurationProtocol
1818
public:
1919
SerialAgentClass();
2020
AgentConfiguratorStates begin();
2121
AgentConfiguratorStates end();
22-
AgentConfiguratorStates poll();
22+
AgentConfiguratorStates update();
2323
void disconnectPeer();
2424
bool receivedMsgAvailable();
2525
bool getReceivedMsg(ProvisioningInputMessage &msg);
@@ -66,7 +66,7 @@ inline ConfiguratorAgent::AgentConfiguratorStates SerialAgentClass::end() {
6666
return _state;
6767
}
6868

69-
inline ConfiguratorAgent::AgentConfiguratorStates SerialAgentClass::poll() {
69+
inline ConfiguratorAgent::AgentConfiguratorStates SerialAgentClass::update() {
7070

7171
switch (_state) {
7272
case AgentConfiguratorStates::INIT: _state = handleInit (); break;
@@ -127,7 +127,7 @@ inline ConfiguratorAgent::AgentConfiguratorStates SerialAgentClass::handleInit()
127127
PacketManager::ReceivingState res = PacketManager::PacketReceiver::getInstance().handleReceivedByte(_packet, byte);
128128
if (res == PacketManager::ReceivingState::RECEIVED) {
129129
if (_packet.Type == PacketManager::MessageType::TRANSMISSION_CONTROL) {
130-
if (_packet.Payload.len() == 1 && _packet.Payload[0] == 0x01) {
130+
if (_packet.Payload.len() == 1 && _packet.Payload[0] == 0x01) {//TODO use define
131131
//CONNECT
132132
nextState = AgentConfiguratorStates::PEER_CONNECTED;
133133
PacketManager::PacketReceiver::getInstance().clear(_packet);

0 commit comments

Comments
 (0)