Skip to content

Commit

Permalink
[VT]: Use internal protocol callbacks for pool upload, standardize lo…
Browse files Browse the repository at this point in the history
…gging calls
  • Loading branch information
ad3154 committed Sep 17, 2022
1 parent f5ce664 commit d1334ff
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 76 deletions.
23 changes: 11 additions & 12 deletions isobus/include/can_general_parameter_group_numbers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@
namespace isobus
{

enum class CANLibParameterGroupNumber
{
enum class CANLibParameterGroupNumber
{
Any = 0x0000,
WorkingSetMaster = 0xFE0D,
VirtualTerminalToECU = 0xE600,
WorkingSetMaster = 0xFE0D,
VirtualTerminalToECU = 0xE600,
ECUtoVirtualTerminal = 0xE700,
Acknowledge = 0xE800,
ParameterGroupNumberRequest = 0xEA00,
TransportProtocolData = 0xEB00,
TransportProtocolCommand = 0xEC00,
AddressClaim = 0xEE00,
ProprietaryA = 0xEF00
};
Acknowledge = 0xE800,
ParameterGroupNumberRequest = 0xEA00,
TransportProtocolData = 0xEB00,
TransportProtocolCommand = 0xEC00,
AddressClaim = 0xEE00,
ProprietaryA = 0xEF00
};

} // namespace isobus

#endif // CAN_GENERAL_PARAMETER_GROUP_NUMBERS_HPP

11 changes: 8 additions & 3 deletions isobus/include/isobus_virtual_terminal_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#ifndef ISOBUS_VIRTUAL_TERMINAL_CLIENT_HPP
#define ISOBUS_VIRTUAL_TERMINAL_CLIENT_HPP

#include "can_partnered_control_function.hpp"
#include "can_internal_control_function.hpp"
#include "can_partnered_control_function.hpp"
#include "processing_flags.hpp"

#include <memory>
#include <vector>
#include <thread>
#include <vector>

namespace isobus
{
Expand Down Expand Up @@ -319,7 +319,7 @@ namespace isobus

// These are the functions for specifying your pool to upload.
// You have a few options:
// 1. Upload in one blob of contigious memory
// 1. Upload in one blob of contigious memory
// This is good for small pools or pools where you have all the data in memory.
// 2. Get a callback at some inteval to provide data in chunks
// This is probably better for huge pools if you are RAM constrained, or if your
Expand Down Expand Up @@ -501,6 +501,11 @@ namespace isobus
ControlFunction *destinationControlFunction,
bool successful,
void *parentPointer);
static bool process_internal_object_pool_upload_callback(std::uint32_t callbackIndex,
std::uint32_t bytesOffset,
std::uint32_t numberOfBytesNeeded,
std::uint8_t *chunkBuffer,
void *parentPointer);

void worker_thread_function();

Expand Down
Loading

0 comments on commit d1334ff

Please sign in to comment.