This repository was archived by the owner on Dec 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 3838#include < Weave/Support/logging/WeaveLogging.h>
3939#include < Weave/Support/CodeUtils.h>
4040#include < Weave/Support/FlagUtils.hpp>
41+ #include < Weave/Support/WeaveFaultInjection.h>
4142
4243#include < BleLayer/BLEEndPoint.h>
4344#include < BleLayer/BleLayer.h>
@@ -764,6 +765,17 @@ BLE_ERROR BLEEndPoint::SendNextMessage()
764765 data = NULL ; // Ownership passed to fragmenter's tx buf on PrepareNextFragment success.
765766
766767 // Send first message fragment over the air.
768+ WEAVE_FAULT_INJECT (nl::Weave::FaultInjection::kFault_WOBLESend ,
769+ {
770+ if (mRole == kBleRole_Central )
771+ {
772+ err = BLE_ERROR_GATT_WRITE_FAILED;
773+ } else {
774+ err = BLE_ERROR_GATT_INDICATE_FAILED;
775+ }
776+ ExitNow ();
777+ }
778+ );
767779 err = SendCharacteristic (mWoBle .TxPacket ());
768780 SuccessOrExit (err);
769781
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ static const nl::FaultInjection::Name sFaultNames[] = {
7474 " TunnelQueueFull" ,
7575 " TunnelPacketDropByPolicy" ,
7676#endif // WEAVE_CONFIG_ENABLE_TUNNELING
77+ #if CONFIG_NETWORK_LAYER_BLE
78+ " WOBLESend" ,
79+ #endif // CONFIG_NETWORK_LAYER_BLE
7780};
7881
7982
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ typedef enum
9292 kFault_TunnelQueueFull , /* *< Trigger a WEAVE_ERROR_TUNNEL_SERVICE_QUEUE_FULL when enqueueing a packet in the Tunnel queue */
9393 kFault_TunnelPacketDropByPolicy , /* *< Trigger an explicit drop of the packet as if done by an application policy */
9494#endif // WEAVE_CONFIG_ENABLE_TUNNELING
95+ #if CONFIG_NETWORK_LAYER_BLE
96+ kFault_WOBLESend , /* *< Inject a GATT error when sending the first fragment of a Weave message over BLE */
97+ #endif // CONFIG_NETWORK_LAYER_BLE
9598 kFault_NumItems ,
9699} Id;
97100
You can’t perform that action at this time.
0 commit comments