ccollins476ad commented on a change in pull request #279: BLE Host - Policy for
SM key overflow
URL:
https://github.com/apache/incubator-mynewt-core/pull/279#discussion_r122786922
##########
File path: net/nimble/host/include/host/ble_store.h
##########
@@ -131,6 +137,40 @@ union ble_store_value {
struct ble_store_value_cccd cccd;
};
+struct ble_store_status_event {
+ /**
+ * The type of object that failed to persist; one of the
+ * BLE_STORE_OBJ_TYPE_[...] codes.
+ */
+ int obj_type;
+
+ /**
+ * The type of event being reported; one of the BLE_STORE_EVENT_TYPE_[...]
+ * codes.
+ */
+ int event_code;
+
+ /**
+ * Additional data related to the event; the valid field is inferred from
+ * the obj_type,event_code pair.
+ */
+ union {
+ /**
+ * The record that failed to be written. Valid for the following event
+ * types:
+ * o BLE_STORE_EVENT_OVERFLOW
Review comment:
I really do want to make changes that you suggest, but, subjectively, I'm
just not sure its an improvement in the signal-to-noise of the code. In my
mind, the concept of "validity" doesn't really apply here. This is a
discriminated union, and the user needs to know which field can be validly
read. That selection is made via the "event_code" field (i.e., that is the
descriminator). The "obj_type" field has no effect on the validity of each
member of the union.
Also, I'm not sure we'll never use this event for the CCCD object type. I
think we should use it for all object types where possible. The current CCCD
persistence code doesn't do a good job of handling all the error cases, so
hopefully we can improve it going forward.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services