Skip to content

Commit 510684d

Browse files
authored
Feat/swarinfo 534 send bytes (#148)
* wip * wip * wip * wip * wip * wip * Revert to ok stack size * Removed testing buzz script
1 parent 6385763 commit 510684d

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ It's possible to change the log level, check how to configure the build dependin
254254
CMake variables can be used to override certain default firmware settings.
255255
| Variable | Default value |
256256
| --- | --- |
257-
| HOST_PORT | 5555 |
257+
| HOST_PORT | 55551 |
258258
| HOST_IP | 192.168.1.101 |
259259
| LOG_LEVEL | Info |
260260
| MAX_ROBOTS_IN_SWARM | 10 |
@@ -269,7 +269,7 @@ ROS launch parameters are used to configure variables.
269269
| Variable | Default value |
270270
|---------------------|---------------------------------|
271271
| board_uuid | 1 (0 is reserved for broadcast) |
272-
| host_tcp_port | 5555 |
272+
| host_tcp_port | 55551 |
273273
| host_tcp_address | 127.0.0.1 |
274274
| remote_mock_port | 12346 |
275275
| log_level | Info |

Diff for: src/Main.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class MessageSenderTask : public AbstractTask<10 * configMINIMAL_STACK_SIZE> {
225225
};
226226

227227
template <typename SerializerType = HiveMindHostSerializer>
228-
class CommMonitoringTask : public AbstractTask<10 * configMINIMAL_STACK_SIZE> {
228+
class CommMonitoringTask : public AbstractTask<12 * configMINIMAL_STACK_SIZE> {
229229
public:
230230
CommMonitoringTask<SerializerType>(const char* taskName,
231231
UBaseType_t priority,
@@ -375,7 +375,6 @@ std::optional<std::reference_wrapper<ICommInterface>> hostInterfaceGetter() {
375375
}
376376
return commInterface;
377377
}
378-
379378
int main(int argc, char** argv) {
380379
CmdLineArgs cmdLineArgs = {argc, argv};
381380

@@ -391,7 +390,7 @@ int main(int argc, char** argv) {
391390

392391
static HardwareInterlocTask s_hardwareInterlocTask("hardware_interloc", gc_taskHighPriority);
393392
static SoftwareInterlocTask s_softwareInterlocTask("software_interloc", gc_taskNormalPriority);
394-
static LogInterlocTask s_logInterlocTask("software_interloc", gc_taskNormalPriority);
393+
static LogInterlocTask s_logInterlocTask("software_interloc_log", gc_taskNormalPriority);
395394

396395
static MessageDispatcherTask s_hostDispatchTask("tcp_dispatch", gc_taskNormalPriority, NULL,
397396
MessageHandlerContainer::getHostMsgQueue());

Diff for: src/bittybuzz/buzz_scripts/main.bzz

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include "blinky.bzz"
22

33
function init() {
4-
exec = create_exec()
4+
exec = create_exec(20);
55
}
66

77
function step() {

Diff for: src/bittybuzz/buzz_scripts/utils/types.bzz

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# .1 = {.arg_float=types.FLOAT} // Same here
66
# };
77
# register_closure("someFunction", someClojure, args_description, nil);
8+
89
types = {
910
.INT = 0,
10-
.FLOAT = 0.0,
11+
.FLOAT = 0.0
1112
}

Diff for: src/bittybuzz/src/BittyBuzzMessageHandler.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ FunctionCallResponseDTO BittyBuzzMessageHandler::handleFunctionCallRequest(
8484
const auto& storedArgs = registeredClosure.m_description.getArguments();
8585
GenericResponseDTO invalidRequestResponse(GenericResponseStatusDTO::BadRequest, "");
8686

87-
if (registeredClosure.m_description.getArgumentsLength() !=
88-
functionRequest.getArgumentsLength()) {
89-
m_logger.log(LogLevel::Warn, "BBZ: function call request args length don't match");
87+
uint16_t expectedLength = registeredClosure.m_description.getArgumentsLength();
88+
uint16_t requiredLength = functionRequest.getArgumentsLength();
89+
if (expectedLength != requiredLength) {
90+
m_logger.log(
91+
LogLevel::Warn,
92+
"BBZ: function call request args length don't match. Expect :%d, received %d",
93+
expectedLength, requiredLength);
9094

9195
invalidRequestResponse.setDetails("arg length don't match");
9296
return invalidRequestResponse;

Diff for: src/bittybuzz/src/BittyBuzzUserFunctions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void BittyBuzzUserFunctions::log() {
6969

7070
LockGuard lock(BittyBuzzSystem::g_ui->getPrintMutex());
7171

72-
constexpr uint16_t objStrSize = 32;
72+
constexpr uint16_t objStrSize = 256;
7373
char objStr[objStrSize];
7474
// Iterate through args, we start a arg 1 up to the nb of
7575
BittyBuzzSystem::g_ui->print("BBZ USER: ");

Diff for: src/bsp/src/posix/src/SettingsContainer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ uint16_t SettingsContainer::getUUID() {
1818

1919
uint32_t SettingsContainer::getHostPort() {
2020
auto handle = getRosNodeHandle();
21-
uint32_t port = (uint32_t)handle->param("host_tcp_port", 7001);
21+
uint32_t port = (uint32_t)handle->param("host_tcp_port", 55551);
2222

2323
return port;
2424
}

0 commit comments

Comments
 (0)