mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-12-22 18:01:10 +02:00
fw/: pass limit also to "first" function of protocol handlers
This commit is contained in:
parent
647f029775
commit
2011c515c8
@ -79,7 +79,7 @@ bool dispatch(const uint8_t *buf, uint8_t len, const struct handler **protos)
|
||||
}
|
||||
if (!*protos)
|
||||
return 0;
|
||||
if (!(*protos)->first(buf+3))
|
||||
if (!(*protos)->first(buf[2], buf+3))
|
||||
return 0;
|
||||
curr_proto = *protos;
|
||||
type = buf[0];
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
struct handler {
|
||||
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);
|
||||
};
|
||||
|
||||
|
@ -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_merge(image_secret, sizeof(image_secret));
|
||||
|
Loading…
Reference in New Issue
Block a user