From 57b114ebbfaab679469122665d75c451bde1478f Mon Sep 17 00:00:00 2001 From: Martin Koegler Date: Mon, 24 Sep 2007 22:26:43 +0200 Subject: [PATCH] Change LoadImage signature to match other functions Signed-off-by: Martin Koegler --- bcugen/loadimage.cpp | 7 ++++--- eibd/client/eibclient-int.h | 2 +- eibd/client/loadimage.c | 14 ++------------ eibd/include/eibclient.h | 8 ++++---- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/bcugen/loadimage.cpp b/bcugen/loadimage.cpp index 2b0ea68..a8d68f3 100644 --- a/bcugen/loadimage.cpp +++ b/bcugen/loadimage.cpp @@ -56,6 +56,7 @@ main (int ac, char *ag[]) printf ("%s", HexDump (p) ()); BCUImage *i; + int res; BCU_LOAD_RESULT r = PrepareLoadImage (p, i); @@ -69,12 +70,12 @@ main (int ac, char *ag[]) if (!con) die ("Open failed"); - r = EIB_LoadImage (con, p.array (), p ()); + res = EIB_LoadImage (con, p (), p.array ()); - if (r == (BCU_LOAD_RESULT) - 1) + if (res == - 1) printf ("Communication with EIBD failed\n"); else - printf ("%s\n", decodeBCULoadResult (r) ()); + printf ("%s\n", decodeBCULoadResult (res) ()); EIBClose (con); return 0; diff --git a/eibd/client/eibclient-int.h b/eibd/client/eibclient-int.h index b08c9f1..f37e71b 100644 --- a/eibd/client/eibclient-int.h +++ b/eibd/client/eibclient-int.h @@ -271,7 +271,7 @@ int _EIB_GetRequest (EIBConnection * con); #define AGARG_NONE #define AGARG_BOOL(name, args) , int name AG##args #define AGARG_ADDR(name, args) , eibaddr_t name AG##args -#define AGARG_INBUF(name, args) , int name##_len, uint8_t *name AG##args +#define AGARG_INBUF(name, args) , int name##_len, const uint8_t *name AG##args #define AGARG_OUTBUF(name, args) , int name##_maxlen, uint8_t *name AG##args #define ALARG_NONE diff --git a/eibd/client/loadimage.c b/eibd/client/loadimage.c index b3f8164..9411c6f 100644 --- a/eibd/client/loadimage.c +++ b/eibd/client/loadimage.c @@ -34,19 +34,9 @@ EIBC_COMPLETE (EIB_LoadImage, EIBC_RETURN_UINT16 (2) ) -int -EIB_LoadImage_async (EIBConnection * con, const uint8_t * image, int image_len) -{ +EIBC_ASYNC (EIB_LoadImage, ARG_INBUF (image, ARG_NONE), EIBC_INIT_SEND (2) EIBC_SEND_BUF (image) EIBC_SEND (EIB_LOAD_IMAGE) EIBC_INIT_COMPLETE (EIB_LoadImage) -} - -BCU_LOAD_RESULT -EIB_LoadImage (EIBConnection * con, const uint8_t * image, int len) -{ - if (EIB_LoadImage_async (con, image, len) == -1) - return -1; - return EIBComplete (con); -} +) diff --git a/eibd/include/eibclient.h b/eibd/include/eibclient.h index 01819c3..9cf8f3c 100644 --- a/eibd/include/eibclient.h +++ b/eibd/include/eibclient.h @@ -736,17 +736,17 @@ int EIB_MC_Write_Plain_async (EIBConnection * con, uint16_t addr, int len, * \param con eibd connection * \param image pointer to image * \param len legth of the image - * \return result, -1 if communication error with eibd + * \return result (for values see IMG_* constants), -1 if communication error with eibd */ -BCU_LOAD_RESULT EIB_LoadImage (EIBConnection * con, const uint8_t * image, - int len); +int EIB_LoadImage (EIBConnection * con, int len, const uint8_t * image); + /** Loads a BCU SDK program image (over a management connection) - asynchronous. * \param con eibd connection * \param image pointer to image * \param len legth of the image * \return 0 if started, -1 if error */ -int EIB_LoadImage_async (EIBConnection * con, const uint8_t * image, int len); +int EIB_LoadImage_async (EIBConnection * con, int len, const uint8_t * image); /** Enable Group Cache -- 2.11.4.GIT