From ebb0fc10505a1f8011a2fea26f882b4fcca7b875 Mon Sep 17 00:00:00 2001 From: bhaskar Date: Mon, 4 Dec 2023 14:58:03 +0530 Subject: [PATCH] read and write changes --- src/routes/tanksRoute.js | 126 +++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 19376aa7..ddd6d096 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -638,69 +638,69 @@ module.exports = function (fastify, opts, next) { - fastify.post('/api/motor/write', { - schema: { - tags: ["Tank"], - description: "This is to Write the motor status", - summary: "This is to Write the motor status", - body: { - type: 'object', - required: ['motor_id', 'status'], - properties: { - motor_id: { type: 'string' }, - status: { type: 'string', enum: ['on', 'off'] }, - current: { type: 'string' }, - temp: { type: 'string' }, - }, - }, - // response: { - // 200: { - // type: 'object', - // properties: { - // // Define your response properties here - // motor_id: { type: 'string' }, - // status: { type: 'string' }, - // current: { type: 'string' }, - // temp: { type: 'string' }, - // // Add other properties as needed - // }, - // }, - // }, - }, - handler: tanksController.writeMotorStatus - - }); - - - fastify.get('/api/motor/read', { - schema: { - tags: ["Tank"], - description: "This is to Read the motor status", - summary: "This is to Read the motor status", - querystring: { - type: 'object', - properties: { - motor_id: { type: 'string' }, - action: { type: 'string', enum: ['1', '2'] }, - }, - required: ['motor_id', 'action'], - }, - // response: { - // 200: { - // type: 'object', - // properties: { - // // Define your response properties here - // motor_id: { type: 'string' }, - // motor_status: { type: 'string' }, - // motor_speed: { type: 'string' }, - // motor_temperature: { type: 'string' }, - // // Add other properties as needed - // }, - // }, - // }, - }, - handler: tanksController.readMotorStatus - }); + // fastify.post('/api/motor/write', { + // schema: { + // tags: ["Tank"], + // description: "This is to Write the motor status", + // summary: "This is to Write the motor status", + // body: { + // type: 'object', + // required: ['motor_id', 'status'], + // properties: { + // motor_id: { type: 'string' }, + // status: { type: 'string', enum: ['on', 'off'] }, + // current: { type: 'string' }, + // temp: { type: 'string' }, + // }, + // }, + // // response: { + // // 200: { + // // type: 'object', + // // properties: { + // // // Define your response properties here + // // motor_id: { type: 'string' }, + // // status: { type: 'string' }, + // // current: { type: 'string' }, + // // temp: { type: 'string' }, + // // // Add other properties as needed + // // }, + // // }, + // // }, + // }, + // handler: tanksController.writeMotorStatus + + // }); + + + // fastify.get('/api/motor/read', { + // schema: { + // tags: ["Tank"], + // description: "This is to Read the motor status", + // summary: "This is to Read the motor status", + // querystring: { + // type: 'object', + // properties: { + // motor_id: { type: 'string' }, + // action: { type: 'string', enum: ['1', '2'] }, + // }, + // required: ['motor_id', 'action'], + // }, + // // response: { + // // 200: { + // // type: 'object', + // // properties: { + // // // Define your response properties here + // // motor_id: { type: 'string' }, + // // motor_status: { type: 'string' }, + // // motor_speed: { type: 'string' }, + // // motor_temperature: { type: 'string' }, + // // // Add other properties as needed + // // }, + // // }, + // // }, + // }, + // handler: tanksController.readMotorStatus + // });