Commit 63205ca9 authored by Pitchaiah Murugan's avatar Pitchaiah Murugan Committed by Benjamin Larsson
Browse files

Change the each ubus button object to lowercase.

parent b650441e
Pipeline #1691 passed with stage
in 23 seconds
......@@ -4,6 +4,7 @@
#include <sys/time.h>
#include <time.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/stat.h>
#include "log.h"
#include "button.h"
......@@ -107,6 +108,10 @@ static const struct blobmsg_policy button_policy[] = {
[BUTTON_MODE] = { .name = "mode", .type = BLOBMSG_TYPE_STRING },
};
void toLower(char* s) {
for(char *p=s; *p; p++) *p=tolower(*p);
}
void button_add( struct button_drv *drv)
{
......@@ -606,10 +611,10 @@ static void add_buttons_to_ubus(struct server_ctx *s_ctx)
ubo = malloc(sizeof(struct ubus_object));
memset(ubo, 0, sizeof(struct ubus_object));
snprintf(name, UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN+1, "%s%s",
UBUS_BUTTON_NAME_PREPEND,
node->name);
toLower(name);
ubo->name = strdup(name);
ubo->methods = button_methods;
ubo->n_methods = ARRAY_SIZE(button_methods);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment