diff --git a/src/avclan/peripheral.hpp b/src/avclan/peripheral.hpp index be61a75..213147c 100644 --- a/src/avclan/peripheral.hpp +++ b/src/avclan/peripheral.hpp @@ -25,6 +25,8 @@ public: uint16_t address() const { return address_; }; uint16_t controller() const { return controller_; }; + void mute(bool mute) { bus.mute(mute); }; + bool is_muted() const { return bus.is_muted(); }; Error::Read read(Frame *in, Frame::Print print) { return bus.read(address_, in, print); @@ -87,8 +89,10 @@ public: out->data[3] = to_underlying(Lancheck_End_Resp); out->reaction = 1; break; - case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(Advertise_Function)): - case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(Advertise_Function)): + case PACK3(COMMUNICATION_V1, COMM_CTRL, + to_underlying(Advertise_Function)): + case PACK3(COMMUNICATION_V2, COMM_CTRL, + to_underlying(Advertise_Function)): ((Devs::id == static_cast(b3) ? std::get(devices_).enable(out), 0 : 0), @@ -108,8 +112,10 @@ public: out->reaction = 1; break; } - case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(List_Functions_Req)): - case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(List_Functions_Req)): { + case PACK3(COMMUNICATION_V1, COMM_CTRL, + to_underlying(List_Functions_Req)): + case PACK3(COMMUNICATION_V2, COMM_CTRL, + to_underlying(List_Functions_Req)): { controller_ = in->controller_addr; out->peripheral_addr = controller_; out->is_unicast = true; diff --git a/src/sniffer.cc b/src/sniffer.cc index ad374f1..a0fc3d8 100644 --- a/src/sniffer.cc +++ b/src/sniffer.cc @@ -127,7 +127,7 @@ int main() { case 'k': toggle_flag(&echoCharacters, "Echo characters: "); break; case 'm': toggle_flag(&muteBus, "Mute device: "); - AVCLAN_muteDevice(muteBus); + peripheral.mute(muteBus); break; // X/x isn't a toggle interface because this is used