kasjer commented on code in PR #3168:
URL: https://github.com/apache/mynewt-core/pull/3168#discussion_r1642737620


##########
sys/log/full/include/log/log.h:
##########
@@ -97,6 +97,7 @@ typedef int (*lh_append_mbuf_body_func_t)(struct log *log,
 typedef int (*lh_walk_func_t)(struct log *,
         log_walk_func_t walk_func, struct log_offset *log_offset);
 typedef int (*lh_flush_func_t)(struct log *);
+typedef uint16_t (*lh_read_entry_len_func_t)(struct log *, const void *dptr);

Review Comment:
   Inconsistent argument list, first argument does not have variable name while 
second has



##########
sys/log/full/include/log/log.h:
##########
@@ -129,25 +131,40 @@ struct log_handler {
 /* Image hash length to be looged */
 #define LOG_IMG_HASHLEN 4
 
-/* Flags used to indicate type of data in reserved payload*/
-#define LOG_FLAGS_IMG_HASH (1 << 0)
+/* Flags used to indicate type of data in reserved payload */
+#define LOG_FLAGS_IMG_HASH    (1 << 0)
+#define LOG_FLAGS_TLV_SUPPORT (1 << 1)
+
+#define LOG_TLV_NUM_ENTRIES   (1 << 0)
 
 #if MYNEWT_VAL(LOG_VERSION) == 3
 struct log_entry_hdr {
     int64_t ue_ts;
     uint32_t ue_index;
     uint8_t ue_module;
     uint8_t ue_level;
-    uint8_t ue_etype:4;
-    uint8_t ue_flags:4;
+    uint8_t ue_etype : 4;
+    uint8_t ue_flags : 4;
     uint8_t ue_imghash[4];
-}__attribute__((__packed__));
+    uint32_t ue_num_entries;

Review Comment:
   What is the meaning of ue_num_entries?



##########
sys/log/full/include/log/log.h:
##########
@@ -511,6 +529,14 @@ void log_printf(struct log *log, uint8_t module, uint8_t 
level,
 int log_read(struct log *log, const void *dptr, void *buf, uint16_t off,
         uint16_t len);
 
+/**
+ * Reads entry length from the specified log.
+ *
+ * @return                      The number of bytes of entry length; 0 on 
failure.

Review Comment:
   Inconsistent doxygen comment, only return value specified it's hard to guess 
what is the meaning of second argument.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to