changes in read and write motor

master
varun 2 years ago
parent 95b77c9891
commit 5f4fe489e6

@ -1477,8 +1477,10 @@ exports.motorstatus = async (req, reply) => {
}; };
exports.readMotorStatus = async (req, reply) => { exports.readMotorStatus = async (req, reply) => {
try { try {
const motor_id = req.query.motor_id; const motor_id = req.query.motor_id;
// Perform any necessary logic based on action (1: Start, 2: Stop) // Perform any necessary logic based on action (1: Start, 2: Stop)
@ -1495,7 +1497,9 @@ exports.readMotorStatus = async (req, reply) => {
} }
}; };
exports.writeMotorStatus = async (req, reply) => { exports.writeMotorStatus = async (req, reply) => {
try { try {
const { motor_id, status, current, temp } = req.body; const { motor_id, status, current, temp } = req.body;

@ -592,9 +592,11 @@ module.exports = function (fastify, opts, next) {
}, },
handler: tanksController.writeMotorStatus handler: tanksController.writeMotorStatus
}); });
fastify.get('/api/motor/read', { fastify.get('/api/motor/read', {
schema: { schema: {
tags: ["Tank"], tags: ["Tank"],

Loading…
Cancel
Save