diff mbox series

[BlueZ,5/6] tools/mesh-gatt: Add generic level model support

Message ID 20211207225604.35156-6-daniele.biagetti@cblelectronics.com (mailing list archive)
State Changes Requested
Headers show
Series tools/mesh-gatt meshctl tool improvements | expand

Checks

Context Check Description
tedd_an/checkpatch fail [BlueZ,5/6] tools/mesh-gatt: Add generic level model support ERROR:CODE_INDENT: code indent should use tabs where possible #154: FILE: tools/mesh-gatt/level-model.c:43: + if (action == ACTION_ADD) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #154: FILE: tools/mesh-gatt/level-model.c:43: + if (action == ACTION_ADD) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #155: FILE: tools/mesh-gatt/level-model.c:44: + if (level_app_idx != APP_IDX_INVALID) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #155: FILE: tools/mesh-gatt/level-model.c:44: + if (level_app_idx != APP_IDX_INVALID) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #156: FILE: tools/mesh-gatt/level-model.c:45: + return MESH_STATUS_INSUFF_RESOURCES;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #156: FILE: tools/mesh-gatt/level-model.c:45: + return MESH_STATUS_INSUFF_RESOURCES;$ ERROR:CODE_INDENT: code indent should use tabs where possible #157: FILE: tools/mesh-gatt/level-model.c:46: + } else {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #157: FILE: tools/mesh-gatt/level-model.c:46: + } else {$ ERROR:CODE_INDENT: code indent should use tabs where possible #158: FILE: tools/mesh-gatt/level-model.c:47: + level_app_idx = app_idx;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #158: FILE: tools/mesh-gatt/level-model.c:47: + level_app_idx = app_idx;$ ERROR:CODE_INDENT: code indent should use tabs where possible #159: FILE: tools/mesh-gatt/level-model.c:48: + bt_shell_printf("Level client model: new binding"$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #159: FILE: tools/mesh-gatt/level-model.c:48: + bt_shell_printf("Level client model: new binding"$ ERROR:CODE_INDENT: code indent should use tabs where possible #160: FILE: tools/mesh-gatt/level-model.c:49: + " %4.4x\n", app_idx);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #160: FILE: tools/mesh-gatt/level-model.c:49: + " %4.4x\n", app_idx);$ ERROR:CODE_INDENT: code indent should use tabs where possible #161: FILE: tools/mesh-gatt/level-model.c:50: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #161: FILE: tools/mesh-gatt/level-model.c:50: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #162: FILE: tools/mesh-gatt/level-model.c:51: + } else {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #162: FILE: tools/mesh-gatt/level-model.c:51: + } else {$ ERROR:CODE_INDENT: code indent should use tabs where possible #163: FILE: tools/mesh-gatt/level-model.c:52: + if (level_app_idx == app_idx)$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #163: FILE: tools/mesh-gatt/level-model.c:52: + if (level_app_idx == app_idx)$ ERROR:CODE_INDENT: code indent should use tabs where possible #164: FILE: tools/mesh-gatt/level-model.c:53: + level_app_idx = APP_IDX_INVALID;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #164: FILE: tools/mesh-gatt/level-model.c:53: + level_app_idx = APP_IDX_INVALID;$ ERROR:CODE_INDENT: code indent should use tabs where possible #165: FILE: tools/mesh-gatt/level-model.c:54: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #165: FILE: tools/mesh-gatt/level-model.c:54: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #166: FILE: tools/mesh-gatt/level-model.c:55: + return MESH_STATUS_SUCCESS;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #166: FILE: tools/mesh-gatt/level-model.c:55: + return MESH_STATUS_SUCCESS;$ ERROR:CODE_INDENT: code indent should use tabs where possible #170: FILE: tools/mesh-gatt/level-model.c:59: + uint8_t step = (remaining_time & 0xc0) >> 6;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #170: FILE: tools/mesh-gatt/level-model.c:59: + uint8_t step = (remaining_time & 0xc0) >> 6;$ ERROR:CODE_INDENT: code indent should use tabs where possible #171: FILE: tools/mesh-gatt/level-model.c:60: + uint8_t count = remaining_time & 0x3f;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #171: FILE: tools/mesh-gatt/level-model.c:60: + uint8_t count = remaining_time & 0x3f;$ ERROR:CODE_INDENT: code indent should use tabs where possible #172: FILE: tools/mesh-gatt/level-model.c:61: + int secs = 0, msecs = 0, minutes = 0, hours = 0;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #172: FILE: tools/mesh-gatt/level-model.c:61: + int secs = 0, msecs = 0, minutes = 0, hours = 0;$ ERROR:CODE_INDENT: code indent should use tabs where possible #173: FILE: tools/mesh-gatt/level-model.c:62: + switch (step) {$ WARNING:LINE_SPACING: Missing a blank line after declarations #173: FILE: tools/mesh-gatt/level-model.c:62: + int secs = 0, msecs = 0, minutes = 0, hours = 0; + switch (step) { WARNING:LEADING_SPACE: please, no spaces at the start of a line #173: FILE: tools/mesh-gatt/level-model.c:62: + switch (step) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #174: FILE: tools/mesh-gatt/level-model.c:63: + case 0:$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #174: FILE: tools/mesh-gatt/level-model.c:63: + case 0:$ ERROR:CODE_INDENT: code indent should use tabs where possible #175: FILE: tools/mesh-gatt/level-model.c:64: + msecs = 100 * count;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #175: FILE: tools/mesh-gatt/level-model.c:64: + msecs = 100 * count;$ ERROR:CODE_INDENT: code indent should use tabs where possible #176: FILE: tools/mesh-gatt/level-model.c:65: + secs = msecs / 1000;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #176: FILE: tools/mesh-gatt/level-model.c:65: + secs = msecs / 1000;$ ERROR:CODE_INDENT: code indent should use tabs where possible #177: FILE: tools/mesh-gatt/level-model.c:66: + msecs -= (secs * 1000);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #177: FILE: tools/mesh-gatt/level-model.c:66: + msecs -= (secs * 1000);$ ERROR:CODE_INDENT: code indent should use tabs where possible #178: FILE: tools/mesh-gatt/level-model.c:67: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #178: FILE: tools/mesh-gatt/level-model.c:67: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #179: FILE: tools/mesh-gatt/level-model.c:68: + case 1:$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #179: FILE: tools/mesh-gatt/level-model.c:68: + case 1:$ ERROR:CODE_INDENT: code indent should use tabs where possible #180: FILE: tools/mesh-gatt/level-model.c:69: + secs = 1 * count;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #180: FILE: tools/mesh-gatt/level-model.c:69: + secs = 1 * count;$ ERROR:CODE_INDENT: code indent should use tabs where possible #181: FILE: tools/mesh-gatt/level-model.c:70: + minutes = secs / 60;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #181: FILE: tools/mesh-gatt/level-model.c:70: + minutes = secs / 60;$ ERROR:CODE_INDENT: code indent should use tabs where possible #182: FILE: tools/mesh-gatt/level-model.c:71: + secs -= (minutes * 60);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #182: FILE: tools/mesh-gatt/level-model.c:71: + secs -= (minutes * 60);$ ERROR:CODE_INDENT: code indent should use tabs where possible #183: FILE: tools/mesh-gatt/level-model.c:72: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #183: FILE: tools/mesh-gatt/level-model.c:72: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #184: FILE: tools/mesh-gatt/level-model.c:73: + case 2:$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #184: FILE: tools/mesh-gatt/level-model.c:73: + case 2:$ ERROR:CODE_INDENT: code indent should use tabs where possible #185: FILE: tools/mesh-gatt/level-model.c:74: + secs = 10 * count;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #185: FILE: tools/mesh-gatt/level-model.c:74: + secs = 10 * count;$ ERROR:CODE_INDENT: code indent should use tabs where possible #186: FILE: tools/mesh-gatt/level-model.c:75: + minutes = secs / 60;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #186: FILE: tools/mesh-gatt/level-model.c:75: + minutes = secs / 60;$ ERROR:CODE_INDENT: code indent should use tabs where possible #187: FILE: tools/mesh-gatt/level-model.c:76: + secs -= (minutes * 60);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #187: FILE: tools/mesh-gatt/level-model.c:76: + secs -= (minutes * 60);$ ERROR:CODE_INDENT: code indent should use tabs where possible #188: FILE: tools/mesh-gatt/level-model.c:77: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #188: FILE: tools/mesh-gatt/level-model.c:77: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #189: FILE: tools/mesh-gatt/level-model.c:78: + case 3:$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #189: FILE: tools/mesh-gatt/level-model.c:78: + case 3:$ ERROR:CODE_INDENT: code indent should use tabs where possible #190: FILE: tools/mesh-gatt/level-model.c:79: + minutes = 10 * count;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #190: FILE: tools/mesh-gatt/level-model.c:79: + minutes = 10 * count;$ ERROR:CODE_INDENT: code indent should use tabs where possible #191: FILE: tools/mesh-gatt/level-model.c:80: + hours = minutes / 60;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #191: FILE: tools/mesh-gatt/level-model.c:80: + hours = minutes / 60;$ ERROR:CODE_INDENT: code indent should use tabs where possible #192: FILE: tools/mesh-gatt/level-model.c:81: + minutes -= (hours * 60);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #192: FILE: tools/mesh-gatt/level-model.c:81: + minutes -= (hours * 60);$ ERROR:CODE_INDENT: code indent should use tabs where possible #193: FILE: tools/mesh-gatt/level-model.c:82: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #193: FILE: tools/mesh-gatt/level-model.c:82: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #194: FILE: tools/mesh-gatt/level-model.c:83: + default:$ ERROR:CODE_INDENT: code indent should use tabs where possible #195: FILE: tools/mesh-gatt/level-model.c:84: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #195: FILE: tools/mesh-gatt/level-model.c:84: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #196: FILE: tools/mesh-gatt/level-model.c:85: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #196: FILE: tools/mesh-gatt/level-model.c:85: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #197: FILE: tools/mesh-gatt/level-model.c:86: + bt_shell_printf("\n\t\tRemaining time: %d hrs %d mins %d secs %d"$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #197: FILE: tools/mesh-gatt/level-model.c:86: + bt_shell_printf("\n\t\tRemaining time: %d hrs %d mins %d secs %d"$ ERROR:CODE_INDENT: code indent should use tabs where possible #198: FILE: tools/mesh-gatt/level-model.c:87: + " msecs\n", hours, minutes, secs, msecs);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #198: FILE: tools/mesh-gatt/level-model.c:87: + " msecs\n", hours, minutes, secs, msecs);$ ERROR:CODE_INDENT: code indent should use tabs where possible #201: FILE: tools/mesh-gatt/level-model.c:90: + uint16_t len, void *user_data)$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #201: FILE: tools/mesh-gatt/level-model.c:90: + uint16_t len, void *user_data)$ ERROR:CODE_INDENT: code indent should use tabs where possible #203: FILE: tools/mesh-gatt/level-model.c:92: + uint32_t opcode;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #203: FILE: tools/mesh-gatt/level-model.c:92: + uint32_t opcode;$ ERROR:CODE_INDENT: code indent should use tabs where possible #204: FILE: tools/mesh-gatt/level-model.c:93: + int n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #204: FILE: tools/mesh-gatt/level-model.c:93: + int n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #205: FILE: tools/mesh-gatt/level-model.c:94: + uint8_t *p;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #205: FILE: tools/mesh-gatt/level-model.c:94: + uint8_t *p;$ ERROR:CODE_INDENT: code indent should use tabs where possible #206: FILE: tools/mesh-gatt/level-model.c:95: + int16_t lev;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #206: FILE: tools/mesh-gatt/level-model.c:95: + int16_t lev;$ ERROR:CODE_INDENT: code indent should use tabs where possible #207: FILE: tools/mesh-gatt/level-model.c:96: + char s[128];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #207: FILE: tools/mesh-gatt/level-model.c:96: + char s[128];$ ERROR:CODE_INDENT: code indent should use tabs where possible #209: FILE: tools/mesh-gatt/level-model.c:98: + if (mesh_opcode_get(data, len, &opcode, &n)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #209: FILE: tools/mesh-gatt/level-model.c:98: + if (mesh_opcode_get(data, len, &opcode, &n)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #210: FILE: tools/mesh-gatt/level-model.c:99: + len -= n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #210: FILE: tools/mesh-gatt/level-model.c:99: + len -= n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #211: FILE: tools/mesh-gatt/level-model.c:100: + data += n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #211: FILE: tools/mesh-gatt/level-model.c:100: + data += n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #212: FILE: tools/mesh-gatt/level-model.c:101: + } else$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #212: FILE: tools/mesh-gatt/level-model.c:101: + } else$ ERROR:CODE_INDENT: code indent should use tabs where possible #213: FILE: tools/mesh-gatt/level-model.c:102: + return false;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #213: FILE: tools/mesh-gatt/level-model.c:102: + return false;$ ERROR:CODE_INDENT: code indent should use tabs where possible #215: FILE: tools/mesh-gatt/level-model.c:104: + switch (opcode) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #215: FILE: tools/mesh-gatt/level-model.c:104: + switch (opcode) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #216: FILE: tools/mesh-gatt/level-model.c:105: + default:$ ERROR:CODE_INDENT: code indent should use tabs where possible #217: FILE: tools/mesh-gatt/level-model.c:106: + return false;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #217: FILE: tools/mesh-gatt/level-model.c:106: + return false;$ ERROR:CODE_INDENT: code indent should use tabs where possible #218: FILE: tools/mesh-gatt/level-model.c:107: + case OP_GENERIC_LEVEL_STATUS:$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #218: FILE: tools/mesh-gatt/level-model.c:107: + case OP_GENERIC_LEVEL_STATUS:$ ERROR:CODE_INDENT: code indent should use tabs where possible #219: FILE: tools/mesh-gatt/level-model.c:108: + bt_shell_printf("Level Model Message received (%d) opcode %x\n",$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #219: FILE: tools/mesh-gatt/level-model.c:108: + bt_shell_printf("Level Model Message received (%d) opcode %x\n",$ ERROR:CODE_INDENT: code indent should use tabs where possible #220: FILE: tools/mesh-gatt/level-model.c:109: + len, opcode);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #220: FILE: tools/mesh-gatt/level-model.c:109: + len, opcode);$ ERROR:CODE_INDENT: code indent should use tabs where possible #221: FILE: tools/mesh-gatt/level-model.c:110: + print_byte_array("\t",data, len);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #221: FILE: tools/mesh-gatt/level-model.c:110: + print_byte_array("\t",data, len);$ ERROR:SPACING: space required after that ',' (ctx:VxV) #221: FILE: tools/mesh-gatt/level-model.c:110: + print_byte_array("\t",data, len); ^ ERROR:CODE_INDENT: code indent should use tabs where possible #223: FILE: tools/mesh-gatt/level-model.c:112: + if (len != 2 && len != 4 && len != 5)$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #223: FILE: tools/mesh-gatt/level-model.c:112: + if (len != 2 && len != 4 && len != 5)$ ERROR:CODE_INDENT: code indent should use tabs where possible #224: FILE: tools/mesh-gatt/level-model.c:113: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #224: FILE: tools/mesh-gatt/level-model.c:113: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #225: FILE: tools/mesh-gatt/level-model.c:114: + lev = 0;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #225: FILE: tools/mesh-gatt/level-model.c:114: + lev = 0;$ ERROR:CODE_INDENT: code indent should use tabs where possible #226: FILE: tools/mesh-gatt/level-model.c:115: + p = (uint8_t *)&lev;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #226: FILE: tools/mesh-gatt/level-model.c:115: + p = (uint8_t *)&lev;$ ERROR:CODE_INDENT: code indent should use tabs where possible #228: FILE: tools/mesh-gatt/level-model.c:117: + p[0] = data[0];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #228: FILE: tools/mesh-gatt/level-model.c:117: + p[0] = data[0];$ ERROR:CODE_INDENT: code indent should use tabs where possible #229: FILE: tools/mesh-gatt/level-model.c:118: + p[1] = data[1];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #229: FILE: tools/mesh-gatt/level-model.c:118: + p[1] = data[1];$ ERROR:CODE_INDENT: code indent should use tabs where possible #231: FILE: tools/mesh-gatt/level-model.c:120: + p[1] = data[0];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #231: FILE: tools/mesh-gatt/level-model.c:120: + p[1] = data[0];$ ERROR:CODE_INDENT: code indent should use tabs where possible #232: FILE: tools/mesh-gatt/level-model.c:121: + p[0] = data[1];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #232: FILE: tools/mesh-gatt/level-model.c:121: + p[0] = data[1];$ ERROR:CODE_INDENT: code indent should use tabs where possible #237: FILE: tools/mesh-gatt/level-model.c:126: + sprintf(s, "Node %4.4x: Level Status present = %d",$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #237: FILE: tools/mesh-gatt/level-model.c:126: + sprintf(s, "Node %4.4x: Level Status present = %d",$ ERROR:CODE_INDENT: code indent should use tabs where possible #238: FILE: tools/mesh-gatt/level-model.c:127: + src, lev);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #238: FILE: tools/mesh-gatt/level-model.c:127: + src, lev);$ ERROR:CODE_INDENT: code indent should use tabs where possible #239: FILE: tools/mesh-gatt/level-model.c:128: + if (len >= 4) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #239: FILE: tools/mesh-gatt/level-model.c:128: + if (len >= 4) {$ WARNING:LONG_LINE: line length of 87 exceeds 80 columns #240: FILE: tools/mesh-gatt/level-model.c:129: + lev = (int16_t)(((uint16_t)data[3] << 8) | (uint16_t)data[2]); ERROR:CODE_INDENT: code indent should use tabs where possible #240: FILE: tools/mesh-gatt/level-model.c:129: + lev = (int16_t)(((uint16_t)data[3] << 8) | (uint16_t)data[2]);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #240: FILE: tools/mesh-gatt/level-model.c:129: + lev = (int16_t)(((uint16_t)data[3] << 8) | (uint16_t)data[2]);$ ERROR:CODE_INDENT: code indent should use tabs where possible #241: FILE: tools/mesh-gatt/level-model.c:130: + sprintf(s, ", target = %d",$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #241: FILE: tools/mesh-gatt/level-model.c:130: + sprintf(s, ", target = %d",$ ERROR:CODE_INDENT: code indent should use tabs where possible #242: FILE: tools/mesh-gatt/level-model.c:131: + lev);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #242: FILE: tools/mesh-gatt/level-model.c:131: + lev);$ ERROR:CODE_INDENT: code indent should use tabs where possible #243: FILE: tools/mesh-gatt/level-model.c:132: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #243: FILE: tools/mesh-gatt/level-model.c:132: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #244: FILE: tools/mesh-gatt/level-model.c:133: + bt_shell_printf("%s\n", s);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #244: FILE: tools/mesh-gatt/level-model.c:133: + bt_shell_printf("%s\n", s);$ ERROR:CODE_INDENT: code indent should use tabs where possible #245: FILE: tools/mesh-gatt/level-model.c:134: + if(len == 5){$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #245: FILE: tools/mesh-gatt/level-model.c:134: + if(len == 5){$ ERROR:SPACING: space required before the open brace '{' #245: FILE: tools/mesh-gatt/level-model.c:134: + if(len == 5){ ERROR:SPACING: space required before the open parenthesis '(' #245: FILE: tools/mesh-gatt/level-model.c:134: + if(len == 5){ WARNING:BRACES: braces {} are not necessary for single statement blocks #245: FILE: tools/mesh-gatt/level-model.c:134: + if(len == 5){ + print_remaining_time(data[4]); + } ERROR:CODE_INDENT: code indent should use tabs where possible #246: FILE: tools/mesh-gatt/level-model.c:135: + print_remaining_time(data[4]);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #246: FILE: tools/mesh-gatt/level-model.c:135: + print_remaining_time(data[4]);$ ERROR:CODE_INDENT: code indent should use tabs where possible #247: FILE: tools/mesh-gatt/level-model.c:136: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #247: FILE: tools/mesh-gatt/level-model.c:136: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #248: FILE: tools/mesh-gatt/level-model.c:137: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #248: FILE: tools/mesh-gatt/level-model.c:137: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #249: FILE: tools/mesh-gatt/level-model.c:138: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #249: FILE: tools/mesh-gatt/level-model.c:138: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #250: FILE: tools/mesh-gatt/level-model.c:139: + return true;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #250: FILE: tools/mesh-gatt/level-model.c:139: + return true;$ ERROR:CODE_INDENT: code indent should use tabs where possible #256: FILE: tools/mesh-gatt/level-model.c:145: + uint32_t i;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #256: FILE: tools/mesh-gatt/level-model.c:145: + uint32_t i;$ ERROR:CODE_INDENT: code indent should use tabs where possible #257: FILE: tools/mesh-gatt/level-model.c:146: + if (!argc)$ WARNING:LINE_SPACING: Missing a blank line after declarations #257: FILE: tools/mesh-gatt/level-model.c:146: + uint32_t i; + if (!argc) WARNING:LEADING_SPACE: please, no spaces at the start of a line #257: FILE: tools/mesh-gatt/level-model.c:146: + if (!argc)$ ERROR:CODE_INDENT: code indent should use tabs where possible #258: FILE: tools/mesh-gatt/level-model.c:147: + return 0;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #258: FILE: tools/mesh-gatt/level-model.c:147: + return 0;$ ERROR:CODE_INDENT: code indent should use tabs where possible #259: FILE: tools/mesh-gatt/level-model.c:148: + --argc;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #259: FILE: tools/mesh-gatt/level-model.c:148: + --argc;$ ERROR:CODE_INDENT: code indent should use tabs where possible #260: FILE: tools/mesh-gatt/level-model.c:149: + ++argv;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #260: FILE: tools/mesh-gatt/level-model.c:149: + ++argv;$ ERROR:CODE_INDENT: code indent should use tabs where possible #261: FILE: tools/mesh-gatt/level-model.c:150: + if (!argc || argv[0][0] == '\0')$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #261: FILE: tools/mesh-gatt/level-model.c:150: + if (!argc || argv[0][0] == '\0')$ ERROR:CODE_INDENT: code indent should use tabs where possible #262: FILE: tools/mesh-gatt/level-model.c:151: + return 0;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #262: FILE: tools/mesh-gatt/level-model.c:151: + return 0;$ ERROR:CODE_INDENT: code indent should use tabs where possible #263: FILE: tools/mesh-gatt/level-model.c:152: + for (i = 0; i < sizeof(parms)/sizeof(parms[0]) && i < (unsigned) argc;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #263: FILE: tools/mesh-gatt/level-model.c:152: + for (i = 0; i < sizeof(parms)/sizeof(parms[0]) && i < (unsigned) argc;$ WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #263: FILE: tools/mesh-gatt/level-model.c:152: + for (i = 0; i < sizeof(parms)/sizeof(parms[0]) && i < (unsigned) argc; WARNING:ARRAY_SIZE: Prefer ARRAY_SIZE(parms) #263: FILE: tools/mesh-gatt/level-model.c:152: + for (i = 0; i < sizeof(parms)/sizeof(parms[0]) && i < (unsigned) argc; ERROR:CODE_INDENT: code indent should use tabs where possible #264: FILE: tools/mesh-gatt/level-model.c:153: + i++) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #264: FILE: tools/mesh-gatt/level-model.c:153: + i++) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #265: FILE: tools/mesh-gatt/level-model.c:154: + if(sscanf(argv[i], "%d", &parms[i]) <= 0)$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #265: FILE: tools/mesh-gatt/level-model.c:154: + if(sscanf(argv[i], "%d", &parms[i]) <= 0)$ ERROR:SPACING: space required before the open parenthesis '(' #265: FILE: tools/mesh-gatt/level-model.c:154: + if(sscanf(argv[i], "%d", &parms[i]) <= 0) ERROR:CODE_INDENT: code indent should use tabs where possible #266: FILE: tools/mesh-gatt/level-model.c:155: + break;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #266: FILE: tools/mesh-gatt/level-model.c:155: + break;$ ERROR:CODE_INDENT: code indent should use tabs where possible #267: FILE: tools/mesh-gatt/level-model.c:156: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #267: FILE: tools/mesh-gatt/level-model.c:156: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #268: FILE: tools/mesh-gatt/level-model.c:157: + return i;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #268: FILE: tools/mesh-gatt/level-model.c:157: + return i;$ ERROR:CODE_INDENT: code indent should use tabs where possible #272: FILE: tools/mesh-gatt/level-model.c:161: + uint32_t dst;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #272: FILE: tools/mesh-gatt/level-model.c:161: + uint32_t dst;$ ERROR:CODE_INDENT: code indent should use tabs where possible #273: FILE: tools/mesh-gatt/level-model.c:162: + char *end;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #273: FILE: tools/mesh-gatt/level-model.c:162: + char *end;$ ERROR:CODE_INDENT: code indent should use tabs where possible #274: FILE: tools/mesh-gatt/level-model.c:163: + dst = strtol(argv[1], &end, 16);$ WARNING:LINE_SPACING: Missing a blank line after declarations #274: FILE: tools/mesh-gatt/level-model.c:163: + char *end; + dst = strtol(argv[1], &end, 16); WARNING:LEADING_SPACE: please, no spaces at the start of a line #274: FILE: tools/mesh-gatt/level-model.c:163: + dst = strtol(argv[1], &end, 16);$ ERROR:CODE_INDENT: code indent should use tabs where possible #275: FILE: tools/mesh-gatt/level-model.c:164: + if (end != (argv[1] + 4)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #275: FILE: tools/mesh-gatt/level-model.c:164: + if (end != (argv[1] + 4)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #276: FILE: tools/mesh-gatt/level-model.c:165: + bt_shell_printf("Bad unicast address %s: "$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #276: FILE: tools/mesh-gatt/level-model.c:165: + bt_shell_printf("Bad unicast address %s: "$ ERROR:CODE_INDENT: code indent should use tabs where possible #277: FILE: tools/mesh-gatt/level-model.c:166: + "expected format 4 digit hex\n", argv[1]);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #277: FILE: tools/mesh-gatt/level-model.c:166: + "expected format 4 digit hex\n", argv[1]);$ ERROR:CODE_INDENT: code indent should use tabs where possible #278: FILE: tools/mesh-gatt/level-model.c:167: + target = UNASSIGNED_ADDRESS;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #278: FILE: tools/mesh-gatt/level-model.c:167: + target = UNASSIGNED_ADDRESS;$ ERROR:CODE_INDENT: code indent should use tabs where possible #279: FILE: tools/mesh-gatt/level-model.c:168: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #279: FILE: tools/mesh-gatt/level-model.c:168: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #280: FILE: tools/mesh-gatt/level-model.c:169: + } else {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #280: FILE: tools/mesh-gatt/level-model.c:169: + } else {$ ERROR:CODE_INDENT: code indent should use tabs where possible #281: FILE: tools/mesh-gatt/level-model.c:170: + bt_shell_printf("Controlling Level for node %4.4x\n", dst);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #281: FILE: tools/mesh-gatt/level-model.c:170: + bt_shell_printf("Controlling Level for node %4.4x\n", dst);$ ERROR:CODE_INDENT: code indent should use tabs where possible #282: FILE: tools/mesh-gatt/level-model.c:171: + target = dst;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #282: FILE: tools/mesh-gatt/level-model.c:171: + target = dst;$ ERROR:CODE_INDENT: code indent should use tabs where possible #283: FILE: tools/mesh-gatt/level-model.c:172: + set_menu_prompt("Level", argv[1]);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #283: FILE: tools/mesh-gatt/level-model.c:172: + set_menu_prompt("Level", argv[1]);$ ERROR:CODE_INDENT: code indent should use tabs where possible #284: FILE: tools/mesh-gatt/level-model.c:173: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #284: FILE: tools/mesh-gatt/level-model.c:173: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ ERROR:CODE_INDENT: code indent should use tabs where possible #285: FILE: tools/mesh-gatt/level-model.c:174: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #285: FILE: tools/mesh-gatt/level-model.c:174: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #289: FILE: tools/mesh-gatt/level-model.c:178: + struct mesh_node *node = node_get_local_node();$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #289: FILE: tools/mesh-gatt/level-model.c:178: + struct mesh_node *node = node_get_local_node();$ ERROR:CODE_INDENT: code indent should use tabs where possible #290: FILE: tools/mesh-gatt/level-model.c:179: + uint8_t ttl;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #290: FILE: tools/mesh-gatt/level-model.c:179: + uint8_t ttl;$ ERROR:CODE_INDENT: code indent should use tabs where possible #291: FILE: tools/mesh-gatt/level-model.c:180: + if(!node)$ WARNING:LINE_SPACING: Missing a blank line after declarations #291: FILE: tools/mesh-gatt/level-model.c:180: + uint8_t ttl; + if(!node) WARNING:LEADING_SPACE: please, no spaces at the start of a line #291: FILE: tools/mesh-gatt/level-model.c:180: + if(!node)$ ERROR:SPACING: space required before the open parenthesis '(' #291: FILE: tools/mesh-gatt/level-model.c:180: + if(!node) ERROR:CODE_INDENT: code indent should use tabs where possible #292: FILE: tools/mesh-gatt/level-model.c:181: + return false;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #292: FILE: tools/mesh-gatt/level-model.c:181: + return false;$ ERROR:CODE_INDENT: code indent should use tabs where possible #293: FILE: tools/mesh-gatt/level-model.c:182: + ttl = node_get_default_ttl(node);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #293: FILE: tools/mesh-gatt/level-model.c:182: + ttl = node_get_default_ttl(node);$ ERROR:CODE_INDENT: code indent should use tabs where possible #294: FILE: tools/mesh-gatt/level-model.c:183: + return net_access_layer_send(ttl, node_get_primary(node),$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #294: FILE: tools/mesh-gatt/level-model.c:183: + return net_access_layer_send(ttl, node_get_primary(node),$ ERROR:CODE_INDENT: code indent should use tabs where possible #295: FILE: tools/mesh-gatt/level-model.c:184: + target, level_app_idx, buf, len);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #295: FILE: tools/mesh-gatt/level-model.c:184: + target, level_app_idx, buf, len);$ ERROR:CODE_INDENT: code indent should use tabs where possible #299: FILE: tools/mesh-gatt/level-model.c:188: + uint16_t n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #299: FILE: tools/mesh-gatt/level-model.c:188: + uint16_t n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #300: FILE: tools/mesh-gatt/level-model.c:189: + uint8_t msg[32];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #300: FILE: tools/mesh-gatt/level-model.c:189: + uint8_t msg[32];$ ERROR:CODE_INDENT: code indent should use tabs where possible #301: FILE: tools/mesh-gatt/level-model.c:190: + struct mesh_node *node;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #301: FILE: tools/mesh-gatt/level-model.c:190: + struct mesh_node *node;$ ERROR:CODE_INDENT: code indent should use tabs where possible #302: FILE: tools/mesh-gatt/level-model.c:191: + if (IS_UNASSIGNED(target)) {$ WARNING:LINE_SPACING: Missing a blank line after declarations #302: FILE: tools/mesh-gatt/level-model.c:191: + struct mesh_node *node; + if (IS_UNASSIGNED(target)) { WARNING:LEADING_SPACE: please, no spaces at the start of a line #302: FILE: tools/mesh-gatt/level-model.c:191: + if (IS_UNASSIGNED(target)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #303: FILE: tools/mesh-gatt/level-model.c:192: + bt_shell_printf("Destination not set\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #303: FILE: tools/mesh-gatt/level-model.c:192: + bt_shell_printf("Destination not set\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #304: FILE: tools/mesh-gatt/level-model.c:193: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #304: FILE: tools/mesh-gatt/level-model.c:193: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #305: FILE: tools/mesh-gatt/level-model.c:194: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #305: FILE: tools/mesh-gatt/level-model.c:194: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #306: FILE: tools/mesh-gatt/level-model.c:195: + node = node_find_by_addr(target);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #306: FILE: tools/mesh-gatt/level-model.c:195: + node = node_find_by_addr(target);$ ERROR:CODE_INDENT: code indent should use tabs where possible #308: FILE: tools/mesh-gatt/level-model.c:197: + if (!node){$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #308: FILE: tools/mesh-gatt/level-model.c:197: + if (!node){$ ERROR:SPACING: space required before the open brace '{' #308: FILE: tools/mesh-gatt/level-model.c:197: + if (!node){ WARNING:BRACES: braces {} are not necessary for single statement blocks #308: FILE: tools/mesh-gatt/level-model.c:197: + if (!node){ + bt_shell_printf("Warning: node %4.4x not found in database\n",target); + } WARNING:LONG_LINE: line length of 86 exceeds 80 columns #309: FILE: tools/mesh-gatt/level-model.c:198: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ERROR:CODE_INDENT: code indent should use tabs where possible #309: FILE: tools/mesh-gatt/level-model.c:198: + bt_shell_printf("Warning: node %4.4x not found in database\n",target);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #309: FILE: tools/mesh-gatt/level-model.c:198: + bt_shell_printf("Warning: node %4.4x not found in database\n",target);$ ERROR:SPACING: space required after that ',' (ctx:VxV) #309: FILE: tools/mesh-gatt/level-model.c:198: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ^ ERROR:CODE_INDENT: code indent should use tabs where possible #310: FILE: tools/mesh-gatt/level-model.c:199: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #310: FILE: tools/mesh-gatt/level-model.c:199: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #312: FILE: tools/mesh-gatt/level-model.c:201: + n = mesh_opcode_set(OP_GENERIC_LEVEL_GET, msg);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #312: FILE: tools/mesh-gatt/level-model.c:201: + n = mesh_opcode_set(OP_GENERIC_LEVEL_GET, msg);$ ERROR:CODE_INDENT: code indent should use tabs where possible #313: FILE: tools/mesh-gatt/level-model.c:202: + if (!send_cmd(msg, n)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #313: FILE: tools/mesh-gatt/level-model.c:202: + if (!send_cmd(msg, n)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #314: FILE: tools/mesh-gatt/level-model.c:203: + bt_shell_printf("Failed to send \"GENERIC LEVEL GET\"\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #314: FILE: tools/mesh-gatt/level-model.c:203: + bt_shell_printf("Failed to send \"GENERIC LEVEL GET\"\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #315: FILE: tools/mesh-gatt/level-model.c:204: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #315: FILE: tools/mesh-gatt/level-model.c:204: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #316: FILE: tools/mesh-gatt/level-model.c:205: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #316: FILE: tools/mesh-gatt/level-model.c:205: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #317: FILE: tools/mesh-gatt/level-model.c:206: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #317: FILE: tools/mesh-gatt/level-model.c:206: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ ERROR:CODE_INDENT: code indent should use tabs where possible #321: FILE: tools/mesh-gatt/level-model.c:210: + uint16_t n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #321: FILE: tools/mesh-gatt/level-model.c:210: + uint16_t n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #322: FILE: tools/mesh-gatt/level-model.c:211: + uint8_t msg[32];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #322: FILE: tools/mesh-gatt/level-model.c:211: + uint8_t msg[32];$ ERROR:CODE_INDENT: code indent should use tabs where possible #323: FILE: tools/mesh-gatt/level-model.c:212: + struct mesh_node *node;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #323: FILE: tools/mesh-gatt/level-model.c:212: + struct mesh_node *node;$ ERROR:CODE_INDENT: code indent should use tabs where possible #324: FILE: tools/mesh-gatt/level-model.c:213: + uint8_t *p;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #324: FILE: tools/mesh-gatt/level-model.c:213: + uint8_t *p;$ ERROR:CODE_INDENT: code indent should use tabs where possible #325: FILE: tools/mesh-gatt/level-model.c:214: + int np;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #325: FILE: tools/mesh-gatt/level-model.c:214: + int np;$ ERROR:CODE_INDENT: code indent should use tabs where possible #326: FILE: tools/mesh-gatt/level-model.c:215: + uint32_t opcode;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #326: FILE: tools/mesh-gatt/level-model.c:215: + uint32_t opcode;$ ERROR:CODE_INDENT: code indent should use tabs where possible #327: FILE: tools/mesh-gatt/level-model.c:216: + int16_t level;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #327: FILE: tools/mesh-gatt/level-model.c:216: + int16_t level;$ ERROR:CODE_INDENT: code indent should use tabs where possible #329: FILE: tools/mesh-gatt/level-model.c:218: + if (IS_UNASSIGNED(target)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #329: FILE: tools/mesh-gatt/level-model.c:218: + if (IS_UNASSIGNED(target)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #330: FILE: tools/mesh-gatt/level-model.c:219: + bt_shell_printf("Destination not set\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #330: FILE: tools/mesh-gatt/level-model.c:219: + bt_shell_printf("Destination not set\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #331: FILE: tools/mesh-gatt/level-model.c:220: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #331: FILE: tools/mesh-gatt/level-model.c:220: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #332: FILE: tools/mesh-gatt/level-model.c:221: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #332: FILE: tools/mesh-gatt/level-model.c:221: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #333: FILE: tools/mesh-gatt/level-model.c:222: + node = node_find_by_addr(target);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #333: FILE: tools/mesh-gatt/level-model.c:222: + node = node_find_by_addr(target);$ ERROR:CODE_INDENT: code indent should use tabs where possible #335: FILE: tools/mesh-gatt/level-model.c:224: + if (!node){$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #335: FILE: tools/mesh-gatt/level-model.c:224: + if (!node){$ ERROR:SPACING: space required before the open brace '{' #335: FILE: tools/mesh-gatt/level-model.c:224: + if (!node){ WARNING:BRACES: braces {} are not necessary for single statement blocks #335: FILE: tools/mesh-gatt/level-model.c:224: + if (!node){ + bt_shell_printf("Warning: node %4.4x not found in database\n",target); + } WARNING:LONG_LINE: line length of 86 exceeds 80 columns #336: FILE: tools/mesh-gatt/level-model.c:225: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ERROR:CODE_INDENT: code indent should use tabs where possible #336: FILE: tools/mesh-gatt/level-model.c:225: + bt_shell_printf("Warning: node %4.4x not found in database\n",target);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #336: FILE: tools/mesh-gatt/level-model.c:225: + bt_shell_printf("Warning: node %4.4x not found in database\n",target);$ ERROR:SPACING: space required after that ',' (ctx:VxV) #336: FILE: tools/mesh-gatt/level-model.c:225: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ^ ERROR:CODE_INDENT: code indent should use tabs where possible #337: FILE: tools/mesh-gatt/level-model.c:226: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #337: FILE: tools/mesh-gatt/level-model.c:226: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #339: FILE: tools/mesh-gatt/level-model.c:228: + np = read_input_parameters(argc, argv);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #339: FILE: tools/mesh-gatt/level-model.c:228: + np = read_input_parameters(argc, argv);$ ERROR:CODE_INDENT: code indent should use tabs where possible #340: FILE: tools/mesh-gatt/level-model.c:229: + if ((np != 1) && (np != 2) &&$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #340: FILE: tools/mesh-gatt/level-model.c:229: + if ((np != 1) && (np != 2) &&$ ERROR:CODE_INDENT: code indent should use tabs where possible #341: FILE: tools/mesh-gatt/level-model.c:230: + parms[0] < -32768 && parms[0] > 32767 &&$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #341: FILE: tools/mesh-gatt/level-model.c:230: + parms[0] < -32768 && parms[0] > 32767 &&$ ERROR:CODE_INDENT: code indent should use tabs where possible #342: FILE: tools/mesh-gatt/level-model.c:231: + parms[1] != 0 && parms[1] != 1) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #342: FILE: tools/mesh-gatt/level-model.c:231: + parms[1] != 0 && parms[1] != 1) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #343: FILE: tools/mesh-gatt/level-model.c:232: + bt_shell_printf("Bad arguments: Expecting an integer "$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #343: FILE: tools/mesh-gatt/level-model.c:232: + bt_shell_printf("Bad arguments: Expecting an integer "$ ERROR:CODE_INDENT: code indent should use tabs where possible #344: FILE: tools/mesh-gatt/level-model.c:233: + "-32768 to 32767 and an optional 0 or 1 as unack\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #344: FILE: tools/mesh-gatt/level-model.c:233: + "-32768 to 32767 and an optional 0 or 1 as unack\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #345: FILE: tools/mesh-gatt/level-model.c:234: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #345: FILE: tools/mesh-gatt/level-model.c:234: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #346: FILE: tools/mesh-gatt/level-model.c:235: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #346: FILE: tools/mesh-gatt/level-model.c:235: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){$ ERROR:SPACING: spaces required around that '==' (ctx:VxV) #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ ^ ERROR:SPACING: space required before the open brace '{' #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ ERROR:SPACING: space prohibited after that open parenthesis '(' #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ ERROR:SPACING: space prohibited before that close parenthesis ')' #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ ERROR:SPACING: space required before the open parenthesis '(' #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ WARNING:BRACES: braces {} are not necessary for any arm of this statement #348: FILE: tools/mesh-gatt/level-model.c:237: + if( (np==2) && parms[1] ){ [...] + }else{ [...] ERROR:CODE_INDENT: code indent should use tabs where possible #349: FILE: tools/mesh-gatt/level-model.c:238: + opcode = OP_GENERIC_LEVEL_SET_UNACK;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #349: FILE: tools/mesh-gatt/level-model.c:238: + opcode = OP_GENERIC_LEVEL_SET_UNACK;$ ERROR:CODE_INDENT: code indent should use tabs where possible #350: FILE: tools/mesh-gatt/level-model.c:239: + }else{$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #350: FILE: tools/mesh-gatt/level-model.c:239: + }else{$ ERROR:SPACING: space required before the open brace '{' #350: FILE: tools/mesh-gatt/level-model.c:239: + }else{ ERROR:SPACING: space required after that close brace '}' #350: FILE: tools/mesh-gatt/level-model.c:239: + }else{ ERROR:CODE_INDENT: code indent should use tabs where possible #351: FILE: tools/mesh-gatt/level-model.c:240: + opcode = OP_GENERIC_LEVEL_SET;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #351: FILE: tools/mesh-gatt/level-model.c:240: + opcode = OP_GENERIC_LEVEL_SET;$ ERROR:CODE_INDENT: code indent should use tabs where possible #352: FILE: tools/mesh-gatt/level-model.c:241: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #352: FILE: tools/mesh-gatt/level-model.c:241: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #354: FILE: tools/mesh-gatt/level-model.c:243: + n = mesh_opcode_set(opcode, msg);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #354: FILE: tools/mesh-gatt/level-model.c:243: + n = mesh_opcode_set(opcode, msg);$ ERROR:CODE_INDENT: code indent should use tabs where possible #355: FILE: tools/mesh-gatt/level-model.c:244: + level = (int16_t)parms[0];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #355: FILE: tools/mesh-gatt/level-model.c:244: + level = (int16_t)parms[0];$ ERROR:CODE_INDENT: code indent should use tabs where possible #356: FILE: tools/mesh-gatt/level-model.c:245: + p = (uint8_t *)&level;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #356: FILE: tools/mesh-gatt/level-model.c:245: + p = (uint8_t *)&level;$ ERROR:CODE_INDENT: code indent should use tabs where possible #358: FILE: tools/mesh-gatt/level-model.c:247: + msg[n++] = p[0];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #358: FILE: tools/mesh-gatt/level-model.c:247: + msg[n++] = p[0];$ ERROR:CODE_INDENT: code indent should use tabs where possible #359: FILE: tools/mesh-gatt/level-model.c:248: + msg[n++] = p[1];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #359: FILE: tools/mesh-gatt/level-model.c:248: + msg[n++] = p[1];$ ERROR:CODE_INDENT: code indent should use tabs where possible #361: FILE: tools/mesh-gatt/level-model.c:250: + msg[n++] = p[1];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #361: FILE: tools/mesh-gatt/level-model.c:250: + msg[n++] = p[1];$ ERROR:CODE_INDENT: code indent should use tabs where possible #362: FILE: tools/mesh-gatt/level-model.c:251: + msg[n++] = p[0];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #362: FILE: tools/mesh-gatt/level-model.c:251: + msg[n++] = p[0];$ ERROR:CODE_INDENT: code indent should use tabs where possible #367: FILE: tools/mesh-gatt/level-model.c:256: + msg[n++] = trans_id++;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #367: FILE: tools/mesh-gatt/level-model.c:256: + msg[n++] = trans_id++;$ ERROR:CODE_INDENT: code indent should use tabs where possible #368: FILE: tools/mesh-gatt/level-model.c:257: + if (!send_cmd(msg, n)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #368: FILE: tools/mesh-gatt/level-model.c:257: + if (!send_cmd(msg, n)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #369: FILE: tools/mesh-gatt/level-model.c:258: + bt_shell_printf("Failed to send \"GENERIC LEVEL SET\"\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #369: FILE: tools/mesh-gatt/level-model.c:258: + bt_shell_printf("Failed to send \"GENERIC LEVEL SET\"\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #370: FILE: tools/mesh-gatt/level-model.c:259: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #370: FILE: tools/mesh-gatt/level-model.c:259: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #371: FILE: tools/mesh-gatt/level-model.c:260: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #371: FILE: tools/mesh-gatt/level-model.c:260: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #372: FILE: tools/mesh-gatt/level-model.c:261: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #372: FILE: tools/mesh-gatt/level-model.c:261: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ ERROR:CODE_INDENT: code indent should use tabs where possible #375: FILE: tools/mesh-gatt/level-model.c:264: + .name = "level",$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #375: FILE: tools/mesh-gatt/level-model.c:264: + .name = "level",$ ERROR:CODE_INDENT: code indent should use tabs where possible #376: FILE: tools/mesh-gatt/level-model.c:265: + .desc = "Level Model Submenu",$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #376: FILE: tools/mesh-gatt/level-model.c:265: + .desc = "Level Model Submenu",$ ERROR:CODE_INDENT: code indent should use tabs where possible #377: FILE: tools/mesh-gatt/level-model.c:266: + .entries = {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #377: FILE: tools/mesh-gatt/level-model.c:266: + .entries = {$ WARNING:LONG_LINE: line length of 85 exceeds 80 columns #378: FILE: tools/mesh-gatt/level-model.c:267: + {"target", "<unicast>", cmd_set_node, ERROR:CODE_INDENT: code indent should use tabs where possible #378: FILE: tools/mesh-gatt/level-model.c:267: + {"target",^I^I"<unicast>",^I^I^Icmd_set_node,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #378: FILE: tools/mesh-gatt/level-model.c:267: + {"target",^I^I"<unicast>",^I^I^Icmd_set_node,$ ERROR:CODE_INDENT: code indent should use tabs where possible #379: FILE: tools/mesh-gatt/level-model.c:268: + "Set node to configure"},$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #379: FILE: tools/mesh-gatt/level-model.c:268: + "Set node to configure"},$ WARNING:LONG_LINE: line length of 87 exceeds 80 columns #380: FILE: tools/mesh-gatt/level-model.c:269: + {"get", NULL, cmd_get_status, ERROR:CODE_INDENT: code indent should use tabs where possible #380: FILE: tools/mesh-gatt/level-model.c:269: + {"get",^I^I^INULL,^I^I^I^Icmd_get_status,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #380: FILE: tools/mesh-gatt/level-model.c:269: + {"get",^I^I^INULL,^I^I^I^Icmd_get_status,$ ERROR:CODE_INDENT: code indent should use tabs where possible #381: FILE: tools/mesh-gatt/level-model.c:270: + "Get Level status"},$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #381: FILE: tools/mesh-gatt/level-model.c:270: + "Get Level status"},$ ERROR:CODE_INDENT: code indent should use tabs where possible #382: FILE: tools/mesh-gatt/level-model.c:271: + {"level",^I^I"<-32768/+32767> [unack]",^Icmd_set,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #382: FILE: tools/mesh-gatt/level-model.c:271: + {"level",^I^I"<-32768/+32767> [unack]",^Icmd_set,$ ERROR:CODE_INDENT: code indent should use tabs where possible #383: FILE: tools/mesh-gatt/level-model.c:272: + "Send \"SET Level\" command"},$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #383: FILE: tools/mesh-gatt/level-model.c:272: + "Send \"SET Level\" command"},$ ERROR:CODE_INDENT: code indent should use tabs where possible #384: FILE: tools/mesh-gatt/level-model.c:273: + {} },$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #384: FILE: tools/mesh-gatt/level-model.c:273: + {} },$ ERROR:CODE_INDENT: code indent should use tabs where possible #387: FILE: tools/mesh-gatt/level-model.c:276: + client_msg_recvd,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #387: FILE: tools/mesh-gatt/level-model.c:276: + client_msg_recvd,$ ERROR:CODE_INDENT: code indent should use tabs where possible #388: FILE: tools/mesh-gatt/level-model.c:277: + client_bind,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #388: FILE: tools/mesh-gatt/level-model.c:277: + client_bind,$ ERROR:CODE_INDENT: code indent should use tabs where possible #389: FILE: tools/mesh-gatt/level-model.c:278: + NULL,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #389: FILE: tools/mesh-gatt/level-model.c:278: + NULL,$ ERROR:CODE_INDENT: code indent should use tabs where possible #390: FILE: tools/mesh-gatt/level-model.c:279: + NULL$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #390: FILE: tools/mesh-gatt/level-model.c:279: + NULL$ ERROR:CODE_INDENT: code indent should use tabs where possible #394: FILE: tools/mesh-gatt/level-model.c:283: + if (!node_local_model_register(ele, GENERIC_LEVEL_CLIENT_MODEL_ID,$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #394: FILE: tools/mesh-gatt/level-model.c:283: + if (!node_local_model_register(ele, GENERIC_LEVEL_CLIENT_MODEL_ID,$ ERROR:CODE_INDENT: code indent should use tabs where possible #395: FILE: tools/mesh-gatt/level-model.c:284: + &client_cbs, NULL))$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #395: FILE: tools/mesh-gatt/level-model.c:284: + &client_cbs, NULL))$ ERROR:CODE_INDENT: code indent should use tabs where possible #396: FILE: tools/mesh-gatt/level-model.c:285: + return false;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #396: FILE: tools/mesh-gatt/level-model.c:285: + return false;$ ERROR:CODE_INDENT: code indent should use tabs where possible #397: FILE: tools/mesh-gatt/level-model.c:286: + bt_shell_add_submenu(&level_menu);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #397: FILE: tools/mesh-gatt/level-model.c:286: + bt_shell_add_submenu(&level_menu);$ ERROR:CODE_INDENT: code indent should use tabs where possible #398: FILE: tools/mesh-gatt/level-model.c:287: + return true;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #398: FILE: tools/mesh-gatt/level-model.c:287: + return true;$ /github/workspace/src/12662891.patch total: 209 errors, 207 warnings, 353 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile /github/workspace/src/12662891.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/gitlint success Gitlint PASS

Commit Message

Daniele Biagetti Dec. 7, 2021, 10:56 p.m. UTC
---
 Makefile.tools                  |   4 +-
 tools/mesh-gatt/level-model.c   | 288 ++++++++++++++++++++++++++++++++
 tools/mesh-gatt/level-model.h   |  21 +++
 tools/mesh-gatt/local_node.json |   6 +-
 tools/meshctl.c                 |   4 +
 5 files changed, 321 insertions(+), 2 deletions(-)
 create mode 100644 tools/mesh-gatt/level-model.c
 create mode 100644 tools/mesh-gatt/level-model.h
diff mbox series

Patch

diff --git a/Makefile.tools b/Makefile.tools
index c7bdff83f..c0d2e27de 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -331,7 +331,9 @@  tools_meshctl_SOURCES = tools/meshctl.c \
 				tools/mesh-gatt/config-client.c \
 				tools/mesh-gatt/config-server.c \
 				tools/mesh-gatt/onoff-model.h \
-				tools/mesh-gatt/onoff-model.c
+				tools/mesh-gatt/onoff-model.c \
+				tools/mesh-gatt/level-model.h \
+				tools/mesh-gatt/level-model.c
 tools_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
 				lib/libbluetooth-internal.la \
 				$(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline
diff --git a/tools/mesh-gatt/level-model.c b/tools/mesh-gatt/level-model.c
new file mode 100644
index 000000000..6feb89d5d
--- /dev/null
+++ b/tools/mesh-gatt/level-model.c
@@ -0,0 +1,288 @@ 
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2017  Intel Corporation. All rights reserved.
+ *
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <sys/uio.h>
+#include <wordexp.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+#include <glib.h>
+
+#include "src/shared/shell.h"
+#include "src/shared/util.h"
+
+#include "tools/mesh-gatt/mesh-net.h"
+#include "tools/mesh-gatt/keys.h"
+#include "tools/mesh-gatt/net.h"
+#include "tools/mesh-gatt/node.h"
+#include "tools/mesh-gatt/prov-db.h"
+#include "tools/mesh-gatt/util.h"
+#include "tools/mesh-gatt/level-model.h"
+
+static uint8_t trans_id;
+static uint16_t level_app_idx = APP_IDX_INVALID;
+static int client_bind(uint16_t app_idx, int action)
+{
+        if (action == ACTION_ADD) {
+                if (level_app_idx != APP_IDX_INVALID) {
+                        return MESH_STATUS_INSUFF_RESOURCES;
+                } else {
+                        level_app_idx = app_idx;
+                        bt_shell_printf("Level client model: new binding"
+                                        " %4.4x\n", app_idx);
+                }
+        } else {
+                if (level_app_idx == app_idx)
+                        level_app_idx = APP_IDX_INVALID;
+        }
+        return MESH_STATUS_SUCCESS;
+}
+static void print_remaining_time(uint8_t remaining_time)
+{
+        uint8_t step = (remaining_time & 0xc0) >> 6;
+        uint8_t count = remaining_time & 0x3f;
+        int secs = 0, msecs = 0, minutes = 0, hours = 0;
+        switch (step) {
+        case 0:
+                msecs = 100 * count;
+                secs = msecs / 1000;
+                msecs -= (secs * 1000);
+                break;
+        case 1:
+                secs = 1 * count;
+                minutes = secs / 60;
+                secs -= (minutes * 60);
+                break;
+        case 2:
+                secs = 10 * count;
+                minutes = secs / 60;
+                secs -= (minutes * 60);
+                break;
+        case 3:
+                minutes = 10 * count;
+                hours = minutes / 60;
+                minutes -= (hours * 60);
+                break;
+        default:
+                break;
+        }
+        bt_shell_printf("\n\t\tRemaining time: %d hrs %d mins %d secs %d"
+                        " msecs\n", hours, minutes, secs, msecs);
+}
+static bool client_msg_recvd(uint16_t src, uint8_t *data,
+                             uint16_t len, void *user_data)
+{
+        uint32_t opcode;
+        int n;
+        uint8_t *p;
+        int16_t lev;
+        char s[128];
+
+        if (mesh_opcode_get(data, len, &opcode, &n)) {
+                len -= n;
+                data += n;
+        } else
+                return false;
+
+        switch (opcode) {
+        default:
+                return false;
+        case OP_GENERIC_LEVEL_STATUS:
+                bt_shell_printf("Level Model Message received (%d) opcode %x\n",
+                                len, opcode);
+                print_byte_array("\t",data, len);
+
+                if (len != 2 && len != 4 && len != 5)
+                        break;
+                lev = 0;
+                p = (uint8_t *)&lev;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+                p[0] = data[0];
+                p[1] = data[1];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+                p[1] = data[0];
+                p[0] = data[1];
+#else
+#error "Unknown byte order"
+#error Processor endianness unknown!
+#endif
+                sprintf(s, "Node %4.4x: Level Status present = %d",
+                                src, lev);
+                if (len >= 4) {
+                        lev = (int16_t)(((uint16_t)data[3] << 8) |  (uint16_t)data[2]);
+                        sprintf(s, ", target = %d",
+                                        lev);
+                }
+                bt_shell_printf("%s\n", s);
+                if(len == 5){
+                        print_remaining_time(data[4]);
+                }
+                break;
+        }
+        return true;
+}
+static uint32_t target;
+static int32_t parms[8];
+static uint32_t read_input_parameters(int argc, char *argv[])
+{
+        uint32_t i;
+        if (!argc)
+                return 0;
+        --argc;
+        ++argv;
+        if (!argc || argv[0][0] == '\0')
+                return 0;
+        for (i = 0; i < sizeof(parms)/sizeof(parms[0]) && i < (unsigned) argc;
+             i++) {
+                if(sscanf(argv[i], "%d", &parms[i]) <= 0)
+                        break;
+        }
+        return i;
+}
+static void cmd_set_node(int argc, char *argv[])
+{
+        uint32_t dst;
+        char *end;
+        dst = strtol(argv[1], &end, 16);
+        if (end != (argv[1] + 4)) {
+                bt_shell_printf("Bad unicast address %s: "
+                                "expected format 4 digit hex\n", argv[1]);
+                target = UNASSIGNED_ADDRESS;
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        } else {
+                bt_shell_printf("Controlling Level for node %4.4x\n", dst);
+                target = dst;
+                set_menu_prompt("Level", argv[1]);
+                return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+        }
+}
+static bool send_cmd(uint8_t *buf, uint16_t len)
+{
+        struct mesh_node *node = node_get_local_node();
+        uint8_t ttl;
+        if(!node)
+                return false;
+        ttl = node_get_default_ttl(node);
+        return net_access_layer_send(ttl, node_get_primary(node),
+                                     target, level_app_idx, buf, len);
+}
+static void cmd_get_status(int argc, char *argv[])
+{
+        uint16_t n;
+        uint8_t msg[32];
+        struct mesh_node *node;
+        if (IS_UNASSIGNED(target)) {
+                bt_shell_printf("Destination not set\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+        node = node_find_by_addr(target);
+
+        if (!node){
+                bt_shell_printf("Warning: node %4.4x not found in database\n",target);
+        }
+
+        n = mesh_opcode_set(OP_GENERIC_LEVEL_GET, msg);
+        if (!send_cmd(msg, n)) {
+                bt_shell_printf("Failed to send \"GENERIC LEVEL GET\"\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+        return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+static void cmd_set(int argc, char *argv[])
+{
+        uint16_t n;
+        uint8_t msg[32];
+        struct mesh_node *node;
+        uint8_t *p;
+        int np;
+        uint32_t opcode;
+        int16_t level;
+
+        if (IS_UNASSIGNED(target)) {
+                bt_shell_printf("Destination not set\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+        node = node_find_by_addr(target);
+
+        if (!node){
+                bt_shell_printf("Warning: node %4.4x not found in database\n",target);
+        }
+
+        np = read_input_parameters(argc, argv);
+        if ((np != 1) && (np != 2) &&
+                        parms[0] < -32768 && parms[0] > 32767 &&
+                        parms[1] != 0 && parms[1] != 1) {
+                bt_shell_printf("Bad arguments: Expecting an integer "
+                                "-32768 to 32767 and an optional 0 or 1 as unack\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+
+        if( (np==2) && parms[1] ){
+                opcode = OP_GENERIC_LEVEL_SET_UNACK;
+        }else{
+                opcode = OP_GENERIC_LEVEL_SET;
+        }
+
+        n = mesh_opcode_set(opcode, msg);
+        level = (int16_t)parms[0];
+        p = (uint8_t *)&level;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+        msg[n++] = p[0];
+        msg[n++] = p[1];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+        msg[n++] = p[1];
+        msg[n++] = p[0];
+#else
+#error "Unknown byte order"
+#error Processor endianness unknown!
+#endif
+        msg[n++] = trans_id++;
+        if (!send_cmd(msg, n)) {
+                bt_shell_printf("Failed to send \"GENERIC LEVEL SET\"\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+        return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+static const struct bt_shell_menu level_menu = {
+        .name = "level",
+        .desc = "Level Model Submenu",
+        .entries = {
+                {"target",		"<unicast>",			cmd_set_node,
+                 "Set node to configure"},
+                {"get",			NULL,				cmd_get_status,
+                 "Get Level status"},
+                {"level",		"<-32768/+32767> [unack]",	cmd_set,
+                 "Send \"SET Level\" command"},
+                {} },
+};
+static struct mesh_model_ops client_cbs = {
+        client_msg_recvd,
+        client_bind,
+        NULL,
+        NULL
+};
+bool level_client_init(uint8_t ele)
+{
+        if (!node_local_model_register(ele, GENERIC_LEVEL_CLIENT_MODEL_ID,
+                                       &client_cbs, NULL))
+                return false;
+        bt_shell_add_submenu(&level_menu);
+        return true;
+}
diff --git a/tools/mesh-gatt/level-model.h b/tools/mesh-gatt/level-model.h
new file mode 100644
index 000000000..1c8b5f72e
--- /dev/null
+++ b/tools/mesh-gatt/level-model.h
@@ -0,0 +1,21 @@ 
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2017  Intel Corporation. All rights reserved.
+ *
+ *
+ */
+#define GENERIC_LEVEL_SERVER_MODEL_ID	0x1002
+#define GENERIC_LEVEL_CLIENT_MODEL_ID	0x1003
+#define OP_GENERIC_LEVEL_GET			0x8205
+#define OP_GENERIC_LEVEL_SET			0x8206
+#define OP_GENERIC_LEVEL_SET_UNACK		0x8207
+#define OP_GENERIC_LEVEL_STATUS			0x8208
+#define OP_GENERIC_DELTA_SET			0x8209
+#define OP_GENERIC_DELTA_SET_UNACK		0x820A
+#define OP_GENERIC_MOVE_SET			0x820B
+#define OP_GENERIC_MOVE_SET_UNACK		0x820C
+void level_set_node(const char *args);
+bool level_client_init(uint8_t ele);
diff --git a/tools/mesh-gatt/local_node.json b/tools/mesh-gatt/local_node.json
index 5ffa7ada1..462cd815d 100644
--- a/tools/mesh-gatt/local_node.json
+++ b/tools/mesh-gatt/local_node.json
@@ -36,7 +36,7 @@ 
             {
                 "elementIndex": 0,
                 "location": "0001",
-                "models": ["0000", "0001", "1001"]
+                "models": ["0000", "0001", "1001", "1003"]
             }
         ]
     },
@@ -52,6 +52,10 @@ 
                {
                  "modelId": "1001",
                  "bind": [1]
+                },
+                {
+                 "modelId": "1003",
+                 "bind": [1]
                 }
             ]
           }
diff --git a/tools/meshctl.c b/tools/meshctl.c
index 18e20c40d..69f8d412f 100644
--- a/tools/meshctl.c
+++ b/tools/meshctl.c
@@ -48,6 +48,7 @@ 
 #include "mesh-gatt/util.h"
 #include "mesh-gatt/prov-db.h"
 #include "mesh-gatt/onoff-model.h"
+#include "mesh-gatt/level-model.h"
 
 /* String display constants */
 #define COLORED_NEW	COLOR_GREEN "NEW" COLOR_OFF
@@ -1999,6 +2000,9 @@  int main(int argc, char *argv[])
 	if (!onoff_client_init(PRIMARY_ELEMENT_IDX))
 		g_printerr("Failed to initialize mesh generic On/Off client\n");
 
+	if (!level_client_init(PRIMARY_ELEMENT_IDX))
+		g_printerr("Failed to initialize mesh generic level client\n");
+
 	status = bt_shell_run();
 
 	g_dbus_client_unref(client);