mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
API: Added icsneoc2.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
This commit is contained in:
+8
-8
@@ -480,7 +480,7 @@ int8_t Device::prepareScriptLoad() {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto resp = std::static_pointer_cast<RawMessage>(generic);
|
||||
const auto resp = std::static_pointer_cast<InternalMessage>(generic);
|
||||
retVal = (int8_t)resp->data[0];
|
||||
}
|
||||
|
||||
@@ -743,7 +743,7 @@ std::optional<CoreminiHeader> Device::readCoreminiHeader(Disk::MemoryType memTyp
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Device::transmit(std::shared_ptr<Frame> frame) {
|
||||
bool Device::transmit(std::shared_ptr<BusMessage> frame) {
|
||||
if(!isOpen()) {
|
||||
report(APIEvent::Type::DeviceCurrentlyClosed, APIEvent::Severity::Error);
|
||||
return false;
|
||||
@@ -776,7 +776,7 @@ bool Device::transmit(std::shared_ptr<Frame> frame) {
|
||||
return com->sendPacket(packet);
|
||||
}
|
||||
|
||||
bool Device::transmit(std::vector<std::shared_ptr<Frame>> frames) {
|
||||
bool Device::transmit(std::vector<std::shared_ptr<BusMessage>> frames) {
|
||||
for(auto& frame : frames) {
|
||||
if(!transmit(frame))
|
||||
return false;
|
||||
@@ -1721,8 +1721,8 @@ void Device::handleInternalMessage(std::shared_ptr<Message> message) {
|
||||
case Message::Type::ResetStatus:
|
||||
latestResetStatus = std::static_pointer_cast<ResetStatusMessage>(message);
|
||||
break;
|
||||
case Message::Type::RawMessage: {
|
||||
auto rawMessage = std::static_pointer_cast<RawMessage>(message);
|
||||
case Message::Type::InternalMessage: {
|
||||
auto rawMessage = std::static_pointer_cast<InternalMessage>(message);
|
||||
switch(rawMessage->network.getNetID()) {
|
||||
case Network::NetID::DeviceStatus:
|
||||
// Device Status format is unique per device, so the devices need to decode it themselves
|
||||
@@ -1733,8 +1733,8 @@ void Device::handleInternalMessage(std::shared_ptr<Message> message) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Message::Type::Frame: {
|
||||
// Device is not guaranteed to be a CANMessage, it might be a RawMessage
|
||||
case Message::Type::BusMessage: {
|
||||
// Device is not guaranteed to be a CANMessage, it might be a InternalMessage
|
||||
// if it couldn't be decoded to a CANMessage. We only care about the
|
||||
// CANMessage decoding right now.
|
||||
auto canmsg = std::dynamic_pointer_cast<CANMessage>(message);
|
||||
@@ -1898,7 +1898,7 @@ std::optional<std::chrono::time_point<std::chrono::system_clock>> Device::getRTC
|
||||
if(!generic) // Did not receive a message
|
||||
return std::nullopt;
|
||||
|
||||
auto rawMes = std::dynamic_pointer_cast<RawMessage>(generic);
|
||||
auto rawMes = std::dynamic_pointer_cast<InternalMessage>(generic);
|
||||
if(!rawMes)
|
||||
return std::nullopt;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void FlexRay::Extension::handleMessage(const std::shared_ptr<Message>& message)
|
||||
}
|
||||
}
|
||||
|
||||
bool FlexRay::Extension::transmitHook(const std::shared_ptr<Frame>& frame, bool& success) {
|
||||
bool FlexRay::Extension::transmitHook(const std::shared_ptr<BusMessage>& frame, bool& success) {
|
||||
if(!frame || frame->network.getType() != Network::Type::FlexRay)
|
||||
return true; // Don't hook non-FlexRay messages
|
||||
|
||||
|
||||
Reference in New Issue
Block a user