1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-22 14:33:09 +02:00

fw/: pass limit also to "first" function of protocol handlers

This commit is contained in:
Werner Almesberger 2012-06-20 18:37:13 -03:00
parent 647f029775
commit 2011c515c8
3 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ bool dispatch(const uint8_t *buf, uint8_t len, const struct handler **protos)
} }
if (!*protos) if (!*protos)
return 0; return 0;
if (!(*protos)->first(buf+3)) if (!(*protos)->first(buf[2], buf+3))
return 0; return 0;
curr_proto = *protos; curr_proto = *protos;
type = buf[0]; type = buf[0];

View File

@ -21,7 +21,7 @@
struct handler { struct handler {
enum pck_type type; enum pck_type type;
bool (*first)(const uint8_t *payload); bool (*first)(uint8_t limit, const uint8_t *payload);
bool (*more)(uint8_t seq, uint8_t limit, const uint8_t *payload); bool (*more)(uint8_t seq, uint8_t limit, const uint8_t *payload);
}; };

View File

@ -61,7 +61,7 @@ static void add_payload(const uint8_t *payload)
} }
static bool image_first(const uint8_t *payload) static bool image_first(uint8_t limit, const uint8_t *payload)
{ {
hash_init(); hash_init();
hash_merge(image_secret, sizeof(image_secret)); hash_merge(image_secret, sizeof(image_secret));