Skip to content

Commit

Permalink
Feat/swarinfo 534 send bytes (#148)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip

* wip

* wip

* wip

* Revert to ok stack size

* Removed testing buzz script
  • Loading branch information
xgroleau authored Oct 14, 2021
1 parent 6385763 commit 510684d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ It's possible to change the log level, check how to configure the build dependin
CMake variables can be used to override certain default firmware settings.
| Variable | Default value |
| --- | --- |
| HOST_PORT | 5555 |
| HOST_PORT | 55551 |
| HOST_IP | 192.168.1.101 |
| LOG_LEVEL | Info |
| MAX_ROBOTS_IN_SWARM | 10 |
Expand All @@ -269,7 +269,7 @@ ROS launch parameters are used to configure variables.
| Variable | Default value |
|---------------------|---------------------------------|
| board_uuid | 1 (0 is reserved for broadcast) |
| host_tcp_port | 5555 |
| host_tcp_port | 55551 |
| host_tcp_address | 127.0.0.1 |
| remote_mock_port | 12346 |
| log_level | Info |
Expand Down
5 changes: 2 additions & 3 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class MessageSenderTask : public AbstractTask<10 * configMINIMAL_STACK_SIZE> {
};

template <typename SerializerType = HiveMindHostSerializer>
class CommMonitoringTask : public AbstractTask<10 * configMINIMAL_STACK_SIZE> {
class CommMonitoringTask : public AbstractTask<12 * configMINIMAL_STACK_SIZE> {
public:
CommMonitoringTask<SerializerType>(const char* taskName,
UBaseType_t priority,
Expand Down Expand Up @@ -375,7 +375,6 @@ std::optional<std::reference_wrapper<ICommInterface>> hostInterfaceGetter() {
}
return commInterface;
}

int main(int argc, char** argv) {
CmdLineArgs cmdLineArgs = {argc, argv};

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

static HardwareInterlocTask s_hardwareInterlocTask("hardware_interloc", gc_taskHighPriority);
static SoftwareInterlocTask s_softwareInterlocTask("software_interloc", gc_taskNormalPriority);
static LogInterlocTask s_logInterlocTask("software_interloc", gc_taskNormalPriority);
static LogInterlocTask s_logInterlocTask("software_interloc_log", gc_taskNormalPriority);

static MessageDispatcherTask s_hostDispatchTask("tcp_dispatch", gc_taskNormalPriority, NULL,
MessageHandlerContainer::getHostMsgQueue());
Expand Down
2 changes: 1 addition & 1 deletion src/bittybuzz/buzz_scripts/main.bzz
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include "blinky.bzz"

function init() {
exec = create_exec()
exec = create_exec(20);
}

function step() {
Expand Down
3 changes: 2 additions & 1 deletion src/bittybuzz/buzz_scripts/utils/types.bzz
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# .1 = {.arg_float=types.FLOAT} // Same here
# };
# register_closure("someFunction", someClojure, args_description, nil);

types = {
.INT = 0,
.FLOAT = 0.0,
.FLOAT = 0.0
}
10 changes: 7 additions & 3 deletions src/bittybuzz/src/BittyBuzzMessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ FunctionCallResponseDTO BittyBuzzMessageHandler::handleFunctionCallRequest(
const auto& storedArgs = registeredClosure.m_description.getArguments();
GenericResponseDTO invalidRequestResponse(GenericResponseStatusDTO::BadRequest, "");

if (registeredClosure.m_description.getArgumentsLength() !=
functionRequest.getArgumentsLength()) {
m_logger.log(LogLevel::Warn, "BBZ: function call request args length don't match");
uint16_t expectedLength = registeredClosure.m_description.getArgumentsLength();
uint16_t requiredLength = functionRequest.getArgumentsLength();
if (expectedLength != requiredLength) {
m_logger.log(
LogLevel::Warn,
"BBZ: function call request args length don't match. Expect :%d, received %d",
expectedLength, requiredLength);

invalidRequestResponse.setDetails("arg length don't match");
return invalidRequestResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/bittybuzz/src/BittyBuzzUserFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void BittyBuzzUserFunctions::log() {

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

constexpr uint16_t objStrSize = 32;
constexpr uint16_t objStrSize = 256;
char objStr[objStrSize];
// Iterate through args, we start a arg 1 up to the nb of
BittyBuzzSystem::g_ui->print("BBZ USER: ");
Expand Down
2 changes: 1 addition & 1 deletion src/bsp/src/posix/src/SettingsContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uint16_t SettingsContainer::getUUID() {

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

return port;
}
Expand Down

0 comments on commit 510684d

Please sign in to comment.