با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
قدردانی ها
برخی از کدهای پیام به تأیید گیرنده نیاز دارند. در این حالت، گیرنده باید یک تأییدیه (ACK) یا تأیید منفی (NAK) را ظرف 1 ثانیه پس از دریافت پیام ارسال کند.
نام گروه پیام
ارزش
تصدیق
0xFF
نام کد تصدیق
ارزش
ACK
0x01
NAK
0x02
قدردانی ها باید مستقیماً پس از دریافت پیام ارسال شوند تا فرستنده بتواند مطابق آن عمل کند. یک تأییدیه باید حاوی گروه پیام، کد و وضعیت فعلی پیامی باشد که به آن ارجاع می دهد. برای مثال، اگر ارائهدهنده پیامی حاوی عمل حلقه ( 0x04010002013C ) دریافت کند، باید با ارسال 0xFF0100040401013C ، این عمل را تأیید کند:
0xFF: رویداد ACK
0x01: کد ACK
0x0004: طول داده های اضافی
0x0401: گروه و کد پیام اقدام
0x013C: وضعیت فعلی گروه و کد پیام اقدام، زنگ به سمت راست و وقفه 60 ثانیه ای
برای یک NAK، دلیل نیز باید به عنوان اولین بایت داده اضافی درج شود. دلایل عبارتند از:
0x00: پشتیبانی نمی شود
0x01: دستگاه مشغول است
0x02: به دلیل وضعیت فعلی مجاز نیست
0x03: به دلیل کد احراز هویت اشتباه پیام مجاز نیست
0x04: عملکرد دستگاه اضافی
از مثال قبلی، اگر قرار بود حلقه به جای آن به دلیل مشغول بودن ارائه دهنده با کار دیگری NAK شود، بسته برگشتی باید روی 0xFF02000401040100 تنظیم شود.
0xFF: رویداد ACK
0x02: کد NAK
0x0004: طول داده های اضافی
0x01: دلیل NAK، دستگاه مشغول است
0x0401: گروه و کد پیام اقدام
0x00: وضعیت فعلی گروه و کد پیام اقدام، زنگ زدن تمام اجزا متوقف می شود
مثال:
#define FP_MSG_ACK 0x01#define FP_MSG_NAK 0x02#define FP_MSG_GROUP_ACK 0xFFstaticvoidfp_msg_send_ack(uint8_tmsgGroup,uint8_tmsgCode){FP_MESSAGE_STREAMreq={FP_MSG_GROUP_ACK,FP_MSG_ACK,0,2};req.data[0]=msgGroup;req.data[1]=msgCode;fp_send((uint8_t*)&req);}staticvoidfp_msg_send_nak(uint8_treason,uint8_tmsgGroup,uint8_tmsgCode){//reason= 0x00: Not supported, 0x01: Device busy, or 0x02: Not allowed due to current stateFP_MESSAGE_STREAMreq={FP_MSG_GROUP_ACK,FP_MSG_NAK,0,3};req.data[0]=reason;req.data[1]=msgGroup;req.data[2]=msgCode;fp_send((uint8_t*)&req);}
تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eSome message codes require an acknowledgement (ACK) or negative-acknowledgement (NAK) response within 1 second, sent only when specified.\u003c/p\u003e\n"],["\u003cp\u003eAcknowledgements (ACKs) use the code \u003ccode\u003e0xFF01\u003c/code\u003e and should include the referenced message's group, code, and current state.\u003c/p\u003e\n"],["\u003cp\u003eNegative-acknowledgements (NAKs) use the code \u003ccode\u003e0xFF02\u003c/code\u003e and provide a reason code (e.g., \u003ccode\u003e0x01\u003c/code\u003e for Device busy) along with the message's group and code.\u003c/p\u003e\n"],["\u003cp\u003eThe acknowledgement structure includes the event (ACK/NAK), code, additional data length, and relevant message details.\u003c/p\u003e\n"],["\u003cp\u003eExample code snippets demonstrate sending ACKs and NAKs using pre-defined message group and code values.\u003c/p\u003e\n"]]],["Receivers must send an acknowledgement (ACK) or negative-acknowledgement (NAK) within one second for specific message codes. ACKs (0x01) and NAKs (0x02) belong to the 0xFF message group. Responses include the message group, code, and current state of the action, and for NAKs, a reason. Example reasons: Not supported (0x00), Device busy (0x01), Not allowed (0x02), Incorrect message code (0x03) or Redundant action (0x04). Example for ring action: `0xFF0100040401013C` or NAK :`0xFF02000401040100`.\n"],null,[]]