From e068d1533f2df576dcf43b997f433849c17edbd1 Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Wed, 15 Mar 2017 12:41:17 -0700 Subject: [aio] Remove unused parameters in open (#830) The device, name and raw properties are all unused, so removing these for fixing #794. Signed-off-by: Jimmy Huang --- src/zjs_aio.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/zjs_aio.c b/src/zjs_aio.c index dfb26b4..a92e342 100644 --- a/src/zjs_aio.c +++ b/src/zjs_aio.c @@ -166,8 +166,7 @@ static jerry_value_t zjs_aio_pin_read(const jerry_value_t function_obj, const jerry_value_t argv[], const jerry_length_t argc) { - uint32_t device, pin; - zjs_obj_get_uint32(this, "device", &device); + uint32_t pin; zjs_obj_get_uint32(this, "pin", &pin); if (pin < ARC_AIO_MIN || pin > ARC_AIO_MAX) { @@ -257,8 +256,7 @@ static jerry_value_t zjs_aio_pin_read_async(const jerry_value_t function_obj, // args: callback ZJS_VALIDATE_ARGS(Z_FUNCTION); - uint32_t device, pin; - zjs_obj_get_uint32(this, "device", &device); + uint32_t pin; zjs_obj_get_uint32(this, "pin", &pin); aio_handle_t *handle = zjs_aio_alloc_handle(); @@ -285,25 +283,10 @@ static jerry_value_t zjs_aio_open(const jerry_value_t function_obj, jerry_value_t data = argv[0]; - uint32_t device; - if (!zjs_obj_get_uint32(data, "device", &device)) - return zjs_error("zjs_aio_open: missing required field (device)"); - uint32_t pin; if (!zjs_obj_get_uint32(data, "pin", &pin)) return zjs_error("zjs_aio_open: missing required field (pin)"); - const int BUFLEN = 32; - char buffer[BUFLEN]; - - if (zjs_obj_get_string(data, "name", buffer, BUFLEN)) { - buffer[0] = '\0'; - } - - char *name = buffer; - bool raw = false; - zjs_obj_get_boolean(data, "raw", &raw); - // send IPM message to the ARC side zjs_ipm_message_t send; send.type = TYPE_AIO_OPEN; @@ -316,10 +299,7 @@ static jerry_value_t zjs_aio_open(const jerry_value_t function_obj, // create the AIOPin object jerry_value_t pinobj = jerry_create_object(); jerry_set_prototype(pinobj, zjs_aio_prototype); - zjs_obj_add_string(pinobj, name, "name"); - zjs_obj_add_number(pinobj, device, "device"); zjs_obj_add_number(pinobj, pin, "pin"); - zjs_obj_add_boolean(pinobj, raw, "raw"); return pinobj; } -- cgit v1.2.3