• VEXcode Robotics Logo VEX Robotics Logo
  • VEX API Home Button VEX API Home Button
  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white
പ്രധാന ഉള്ളടക്കത്തിലേക്ക് പോകുക
Ctrl+K

< Back to Platform Select

  • VEX V5
  • VEX V5 API റഫറൻസ്
  • VEXലിങ്ക്
  • സന്ദേശ ലിങ്ക്
മലയാളം
  • English
  • العربية
  • বাংলা
  • Česky
  • Deutsch
  • Ελληνικά
  • Español
  • Español Latinoamericano
  • Suomi
  • Français
  • Gaeilge
  • हिंदी
  • Magyar
  • Bahasa Indonesia
  • 日本語
  • 한국어
  • Lietuvių
  • Latviešu
  • Nederlands
  • Polski
  • Português
  • Русский
  • Svenska
  • ไทย
  • Türkçe
  • Українська
  • Tiếng Việt
  • 简体中文
  • 繁體中文
  • VEXcode Robotics Logo

വിഭാഗം നാവിഗേഷൻ

  • ബ്ലോക്കുകൾ
  • Python
  • C++
    • ഡ്രൈവ്‌ട്രെയിൻ
    • മോട്ടോറുകളും മോട്ടോർ കൺട്രോളറുകളും
    • കൺട്രോളർ
    • തലച്ചോറ്
    • മത്സരം
    • സ്മാർട്ട് പോർട്ട് ഉപകരണങ്ങൾ
    • 3-വയർ ഉപകരണങ്ങൾ
    • കൺസോൾ
    • ലോജിക്
    • VEXലിങ്ക്
      • സന്ദേശ ലിങ്ക്
      • സീരിയൽ ലിങ്ക്
    • സിടിഇ വർക്ക്സെൽ
  • VEXcode ട്യൂട്ടോറിയലുകൾ

പ്ലാറ്റ്‌ഫോം നാവിഗേഷൻ

  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white

സന്ദേശ ലിങ്ക്#

  • ആമുഖം

  • ക്ലാസ് കൺസ്ട്രക്‌ടറുകൾ

  • ക്ലാസ് ഡിസ്ട്രക്റ്റർ

  • പാരാമീറ്ററുകൾ

  • ഉദാഹരണം

  • അംഗ പ്രവർത്തനങ്ങൾ

    • ലിങ്ക് ചെയ്‌തിരിക്കുന്നു

    • അയയ്ക്കുക

    • സ്വീകരിക്കുക

    • ലഭിച്ചു

ആമുഖം#

message_link ക്ലാസ് രണ്ട് V5 ബ്രെയിനുകളെ ഓപ്ഷണൽ ചെറിയ ഡാറ്റ ഉപയോഗിച്ച് ഷോർട്ട് സ്ട്രിംഗ് സന്ദേശങ്ങൾ അയച്ചുകൊണ്ട് ആശയവിനിമയം നടത്താൻ അനുവദിക്കുന്നു. റോബോട്ട്-ടു-റോബോട്ട് ഏകോപനത്തിനായി ഇത് രൂപകൽപ്പന ചെയ്‌തിരിക്കുന്നു - ദിനചര്യകൾ ആരംഭിക്കുക, സെൻസർ ഫലങ്ങൾ പങ്കിടുക, അല്ലെങ്കിൽ മറ്റൊരു റോബോട്ടിൽ പെരുമാറ്റങ്ങൾ ട്രിഗർ ചെയ്യുക എന്നിവ പോലെ.

send ന്റെ ഓരോ ഉപയോഗവും ലിങ്ക് ചെയ്‌ത V5 ബ്രെയിനിന്റെ ക്യൂവിലേക്ക് ഒരു സന്ദേശം ചേർക്കുന്നു, കൂടാതെ ക്യൂ ആദ്യം വായിക്കുകയും ആദ്യം വായിക്കുകയും ചെയ്യുന്നു (FIFO). മറ്റ് V5 ബ്രെയിൻ receive ഉപയോഗിക്കുന്നതിന് മുമ്പ് ഒന്നിലധികം സന്ദേശങ്ങൾ അയച്ചാൽ, അവ അയച്ച ക്രമത്തിൽ ഒരു സമയം സംഭരിക്കുകയും തിരികെ നൽകുകയും ചെയ്യും. സന്ദേശങ്ങൾക്ക് ക്യൂ ചെയ്യാൻ കഴിയുന്നതിനാൽ, ഓരോ ലൂപ്പിലും ഒരേ സ്റ്റാറ്റസ് ആവർത്തിച്ച് അയയ്ക്കുന്നത് ബാക്ക്‌ലോഗ് സൃഷ്ടിച്ചേക്കാം; സമയ-നിർണ്ണായക യുക്തിക്ക്, മൂല്യങ്ങൾ മാറുമ്പോൾ മാത്രം അയയ്ക്കുക.

പ്രധാനം: രണ്ട് റോബോട്ടുകളും ഒരേ സമയം message_link ഉപയോഗിക്കുന്ന പ്രോജക്ടുകൾ പ്രവർത്തിപ്പിക്കുന്നുണ്ടാകണം, അല്ലെങ്കിൽ സന്ദേശങ്ങളൊന്നും അയയ്ക്കുകയോ സ്വീകരിക്കുകയോ ചെയ്യില്ല.

ക്ലാസ് കൺസ്ട്രക്‌ടറുകൾ#

message_link( 
  int32_t     index, 
  const char  *name, 
  linkType    type, 
  bool        isWired = false );

ക്ലാസ് ഡിസ്ട്രക്റ്റർ#

message_link ഒബ്‌ജക്റ്റ് നശിപ്പിക്കുകയും അനുബന്ധ ഉറവിടങ്ങൾ പുറത്തുവിടുകയും ചെയ്യുന്നു.

virtual ~message_link();

പാരാമീറ്ററുകൾ#

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

index

int32_t

V5 റേഡിയോ അല്ലെങ്കിൽ സ്മാർട്ട് കേബിൾ ബന്ധിപ്പിച്ചിരിക്കുന്ന സ്മാർട്ട് പോർട്ട്, PORTxഎന്ന് എഴുതിയിരിക്കുന്നു, ഇവിടെ x എന്നത് പോർട്ട് നമ്പറാണ് (ഉദാഹരണത്തിന്, PORT1).

name

char

സന്ദേശ ലിങ്കിന്റെ പേര്.

type

linkType

ലിങ്കിന്റെ തരം, ഒന്നുകിൽ linkType::manager അല്ലെങ്കിൽ linkType::workerറേഡിയോ ശരിയായി കോൺഫിഗർ ചെയ്യാൻ ഈ വിവരങ്ങൾ ഉപയോഗിക്കുന്നു, കൂടാതെ ട്രാൻസ്മിഷനും സ്വീകരണത്തിനും ലഭ്യമായ ബാൻഡ്‌വിഡ്ത്ത് നിർണ്ണയിക്കുന്നു. വർക്കർ റോബോട്ടിന് വിവരങ്ങൾ അയയ്ക്കാൻ ഒരു മാനേജർ റോബോട്ടിന് ലഭ്യമായ ബാൻഡ്‌വിഡ്ത്തിന്റെ ഇരട്ടി (1040 ബൈറ്റുകൾ/സെക്കൻഡ്) ഉണ്ട് (520 ബൈറ്റുകൾ/സെക്കൻഡ്).

  • linkType::manager - message_link ഒബ്‌ജക്റ്റ് ഒരു മാനേജരാണ്.
  • linkType::worker - message_link ഒബ്‌ജക്റ്റ് ഒരു വർക്കർ ആണ്.

isWired

bool

message_link ഒബ്‌ജക്റ്റ് വയർഡ് ആണോ എന്ന്.

  • true - message_link ഒബ്‌ജക്റ്റ് വയർഡ് ആണോ എന്ന്.
  • false - message_link ഒബ്‌ജക്റ്റ് വയർലെസ് ആണ്.

ഉദാഹരണം#

റോബോട്ട് 1 നുള്ള കോഡ്

// Create a wireless link in Port 1
message_link link = message_link(
  PORT1, // index
  "VEXRoboticsLink123456789", // name
  linkType::manager, // type
  true); // isWired

റോബോട്ട് 2 നുള്ള കോഡ്

// Create a wireless link in Port 1
message_link link = message_link(
  PORT1, // index
  "VEXRoboticsLink123456789", // name
  linkType::worker, // type
  true); // isWired

അംഗ പ്രവർത്തനങ്ങൾ#

message_link ക്ലാസ്സിൽ ഇനിപ്പറയുന്ന അംഗ ഫംഗ്‌ഷനുകൾ ഉൾപ്പെടുന്നു:

  • isLinked — ഈ ബ്രെയിൻ അതിന്റെ ജോടിയാക്കിയ ബ്രെയിനുമായി സജീവമായി ബന്ധിപ്പിച്ചിട്ടുണ്ടോ എന്ന് നൽകുന്നു.

  • send — ജോടിയാക്കിയ തലച്ചോറിലേക്ക് ഒരു സന്ദേശം അയയ്ക്കുന്നു.

  • receive — അടുത്ത ഇൻകമിംഗ് സന്ദേശത്തിനായി കാത്തിരുന്ന് തിരികെ നൽകുന്നു.

  • received — ഒരു പുതിയ സന്ദേശം ലഭിക്കുമ്പോഴെല്ലാം വിളിക്കേണ്ട ഒരു ഫംഗ്ഷൻ രജിസ്റ്റർ ചെയ്യുന്നു.

ഏതെങ്കിലും message_link അംഗ ഫംഗ്ഷനുകൾ വിളിക്കുന്നതിന് മുമ്പ്, താഴെ കാണിച്ചിരിക്കുന്നതുപോലെ ഒരു message_link ഉദാഹരണം സൃഷ്ടിക്കണം:

റോബോട്ട് 1 നുള്ള കോഡ്

// Create a wireless link in Port 1
message_link link = message_link(
  PORT1, // index
  "VEXRoboticsLink123456789", // name
  linkType::manager, // type
  true); // isWired

റോബോട്ട് 2 നുള്ള കോഡ്

// Create a wireless link in Port 1
message_link link = message_link(
  PORT1, // index
  "VEXRoboticsLink123456789", // name
  linkType::worker, // type
  true); // isWired

isLinked#

isLinked രീതി, ഒരു MessageLink-ലെ V5 ബ്രെയിനുകൾ പരസ്പരം ജോടിയാക്കുന്നുണ്ടോ എന്ന് നൽകുന്നു.

Available Functions
bool isLinked();

Parameters

ഈ ഫംഗ്ഷന് ഒരു പാരാമീറ്ററുകളും ഇല്ല.

Return Values

ഈ ഫംഗ്ഷൻ ഒരു ബൂളിയൻ മൂല്യം നൽകുന്നു.

  • true – രണ്ട് V5 തലച്ചോറുകളും ഈ ലിങ്കിൽ ജോടിയാക്കുകയും ആശയവിനിമയം നടത്തുകയും ചെയ്യുന്നു.

  • false – ഈ ലിങ്കിൽ രണ്ട് V5 ബ്രെയിനുകളും ജോടിയാക്കിയിട്ടില്ല.

Notes

കൂടുതൽ കോഡ് പ്രവർത്തിപ്പിക്കുന്നതിന് മുമ്പ് ഒരു പ്രോജക്റ്റിന്റെ തുടക്കത്തിൽ V5 ബ്രെയിനുകൾ ലിങ്ക് ചെയ്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുന്നത് എപ്പോഴും നല്ല രീതിയാണ്.

Examples

റോബോട്ട് 1 നുള്ള കോഡ്

// Tell the other robot when the screen is being pressed
  // Create the link
  message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::manager, true);

  // Do not run code UNTIL the Brains are linked
  while (!link.isLinked()){
    wait(0.1, seconds);
  }

  Brain.Screen.print("Robot 1 - Manager");

  // Continuously send if the screen is being pressed
  while (true){
    if (Brain.Screen.pressing()){
      link.send("pressed");
    } else {
      link.send("released");
    }
    wait(0.05, seconds);
  }

റോബോട്ട് 2 നുള്ള കോഡ്

// Display if the other robot's screen is being pressed

  // Create the link
  message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::worker, true);
  
  // Do not run code UNTIL the Brains are linked
  while (!link.isLinked()){
   wait(0.1, seconds);
  }

  // Continuously check if Robot 1 has sent "pressed"
  while (true){
    Brain.Screen.clearScreen();
    Brain.Screen.setCursor(1, 1);
    Brain.Screen.print("Robot 2 - Worker");
    Brain.Screen.newLine();
    char msg[32] = {0};                         // buffer for incoming message
    int32_t n = link.receive(msg, sizeof(msg), 100);  // wait up to 100ms
    if (n > 0 && strcmp(msg, "pressed") == 0) {
      Brain.Screen.newLine();
      Brain.Screen.print("Manager is being pressed!");
    }
    wait(0.05, seconds);
  }

send#

ലിങ്ക് കണക്ഷനിലൂടെ ഒരു സന്ദേശം അയയ്ക്കുന്നു.

Available Functions

1 — ഒരു സന്ദേശ സ്ട്രിംഗ് അയയ്ക്കുന്നു.

int32_t send( 
  const char *message );

2 — double ഉള്ള ഒരു സന്ദേശ സ്ട്രിംഗ് അയയ്ക്കുന്നു.

int32_t send( 
  const char *message, 
  double      value );

3 — int32_t ഉം double ഉള്ള ഒരു സന്ദേശ സ്ട്രിംഗ് അയയ്ക്കുന്നു.

int32_t send(
  const char *message, 
  int32_t     index, 
  double      value );

Parameters

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

message

const char*

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റേ V5 ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട സന്ദേശം.

index

int32_t

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട ഒരു പൂർണ്ണസംഖ്യ.

value

double

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട ഒരു ഇരട്ടി. ഇരട്ടികൾ 4 ദശാംശ സ്ഥാനങ്ങളിലേക്ക് ഫോർമാറ്റ് ചെയ്‌തിരിക്കുന്നു; കുറച്ച് ദശാംശങ്ങൾ നൽകിയിട്ടുണ്ടെങ്കിൽ, 4 കാണിക്കുന്നത് വരെ പിന്നിലുള്ള പൂജ്യങ്ങൾ ചേർക്കും.

Return Values

ഈ ഫംഗ്ഷൻ ഒരു മൂല്യങ്ങളും തിരികെ നൽകുന്നില്ല.

Notes

message V5 ബ്രെയിനിന് അതേ സന്ദേശം ലഭിക്കും.

value (നൽകിയിട്ടുണ്ടെങ്കിൽ index ) ഉൾപ്പെടുത്തിയാൽ, സ്വീകരിക്കുന്ന തലച്ചോറിന് ഈ ക്രമത്തിൽ എല്ലാ ഫീൽഡുകളും സംയോജിപ്പിക്കുന്ന ഒരൊറ്റ എൻകോഡ് ചെയ്ത സന്ദേശം ലഭിക്കും: .message_index_value

Examples

link.send(“string”, 1, 2.55) .string_1_2.5500.

റോബോട്ട് 1 നുള്ള കോഡ്

// Tell the other robot when the screen is being pressed

// Create the link
message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::manager, true);

// Do not run code UNTIL the Brains are linked
while (!link.isLinked()){
  wait(0.1, seconds);
}

Brain.Screen.print("Robot 1 - Manager");

// Continuously send if the screen is being pressed
while (true){
  if (Brain.Screen.pressing()){
    link.send("pressed");
  } else {
    link.send("released");
  }
  wait(0.05, seconds);
}

റോബോട്ട് 2 നുള്ള കോഡ്

// Display if the other robot's screen is being pressed

// Create the link
message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::worker, true);

// Do not run code UNTIL the Brains are linked
while (!link.isLinked()){
  wait(0.1, seconds);
}
// Continuously check if Robot 1 has sent "pressed"
while (true){
  Brain.Screen.clearScreen();
  Brain.Screen.setCursor(1, 1);
  Brain.Screen.print("Robot 2 - Worker");
  Brain.Screen.newLine();
  char msg[32] = {0};  // buffer for incoming message
  int32_t n = link.receive(msg, sizeof(msg), 100);  // wait up to 100ms
  if (n > 0 && strcmp(msg, "pressed") == 0) {
    Brain.Screen.newLine();
    Brain.Screen.print("Manager is being pressed!");
  }
  wait(0.05, seconds);
}

receive#

ലിങ്ക് കണക്ഷനിൽ നിന്ന് ഒരു സന്ദേശം സ്വീകരിക്കുന്നു.

Available Functions
int32_t receive(
  char     *buffer,
  int32_t   length, 
  int32_t   timeoutMs = 500 );

Parameters

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

buffer

char*

ലഭിച്ച സന്ദേശം സൂക്ഷിക്കുന്നതിനുള്ള ബഫർ.

length

int32_t

ബഫറിന്റെ നീളം.

timeoutMs

int32_t

ക്യൂ ശൂന്യമാണെങ്കിൽ മാത്രം receive ലഭിക്കുന്നതിന് മില്ലിസെക്കൻഡുകളിൽ എത്ര സമയം പുതിയ സന്ദേശത്തിനായി കാത്തിരിക്കും. സ്ഥിരസ്ഥിതി 300,000 (300 സെക്കൻഡ്) ആണ്.

Return Values

ഈ ഫംഗ്ഷൻ ലഭിച്ച ബൈറ്റുകളുടെ എണ്ണം തിരികെ നൽകുന്നു.

Notes
  • receive ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിനിൽ നിന്നുള്ള അടുത്ത ക്യൂ ചെയ്‌ത സന്ദേശം തിരികെ നൽകുന്നു. സന്ദേശങ്ങൾ FIFO ക്രമത്തിലാണ് വായിക്കുന്നത് (പഴയതും വായിക്കാത്തതും ആദ്യം). receive വിളിക്കുമ്പോൾ ക്യൂ ശൂന്യമാണെങ്കിൽ, ഒരു പുതിയ സന്ദേശത്തിനായി നിർദ്ദിഷ്ട receive വരെ അത് കാത്തിരിക്കും. ആ വിൻഡോയിൽ ഒരു സന്ദേശവും വന്നില്ലെങ്കിൽ, receive 0തിരികെ നൽകുന്നു, തുടർന്ന് അയച്ച ഏതൊരു സന്ദേശവും അടുത്ത തവണ timeout ഉപയോഗിക്കുമ്പോൾ വായിക്കേണ്ട ക്യൂവിൽ തന്നെ തുടരും.

  • ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിൻ ഒരു stringമാത്രമേ അയച്ചിട്ടുള്ളൂവെങ്കിൽ, receive ആ കൃത്യമായ സ്ട്രിംഗ് തിരികെ നൽകുന്നു.

  • ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിൻ ഒരു പൂർണ്ണസംഖ്യയും/അല്ലെങ്കിൽ ഫ്ലോട്ടും അയച്ചാൽ, receive എല്ലാ ഫീൽഡുകളും ഈ ക്രമത്തിൽ സംയോജിപ്പിക്കുന്ന ഒരു എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് തിരികെ നൽകുന്നു: .string_integer_float

    • ഉദാഹരണത്തിന്, ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു V5 ബ്രെയിൻ link.send(“string”, 1, 2.55)ഉപയോഗിക്കുന്നുവെങ്കിൽ, link.receive() ഉപയോഗിക്കുന്നത് .string_1_2.5500പോലുള്ള ഒരു എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് തിരികെ നൽകുന്നു. സന്ദേശ നാമം, പൂർണ്ണസംഖ്യ, ഫ്ലോട്ട് മൂല്യങ്ങൾ എന്നിവ എക്‌സ്‌ട്രാക്‌റ്റ് ചെയ്യുന്നതിന് നിങ്ങൾക്ക് ഈ എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് വിഭജിക്കാം (ചുവടെയുള്ള ഉദാഹരണങ്ങൾ കാണുക).

    • മാനുവൽ സ്പ്ലിറ്റിംഗ്/പാഴ്‌സിംഗ് ഒഴിവാക്കാൻ നിങ്ങൾ ആഗ്രഹിക്കുന്നുവെങ്കിൽ, ഒരു പ്രത്യേക സന്ദേശ നാമത്തിനായി ഒരു ഹാൻഡ്‌ലറെ രജിസ്റ്റർ ചെയ്യുന്നതിന് received ഉപയോഗിക്കുക; അയച്ച മൂല്യങ്ങൾ ആർഗ്യുമെന്റുകളായി ഹാൻഡ്‌ലറിന് ലഭിക്കും.

Examples

link.send(“string”, 1, 2.55) .string_1_2.5500.

റോബോട്ട് 1 നുള്ള കോഡ്

// Tell the other robot when the screen is being pressed

// Create the link
message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::manager, true);

// Do not run code UNTIL the Brains are linked
while (!link.isLinked()){
  wait(0.1, seconds);
}

Brain.Screen.print("Robot 1 - Manager");

// Continuously send if the screen is being pressed
while (true){
  if (Brain.Screen.pressing()){
    link.send("pressed");
  } else {
    link.send("released");
  }
  wait(0.05, seconds);
}

റോബോട്ട് 2 നുള്ള കോഡ്

// Display if the other robot's screen is being pressed

// Create the link
message_link link = message_link(PORT1, "VEXRoboticsLink123456789", linkType::worker, true);

// Do not run code UNTIL the Brains are linked
while (!link.isLinked()){
  wait(0.1, seconds);
}
// Continuously check if Robot 1 has sent "pressed"
while (true){
  Brain.Screen.clearScreen();
  Brain.Screen.setCursor(1, 1);
  Brain.Screen.print("Robot 2 - Worker");
  Brain.Screen.newLine();
  char msg[32] = {0};   // buffer for incoming message
  int32_t n = link.receive(msg, sizeof(msg), 100);  // wait up to 100ms
  if (n > 0 && strcmp(msg, "pressed") == 0) {
    Brain.Screen.newLine();
    Brain.Screen.print("Manager is being pressed!");
  }
  wait(0.05, seconds);
}

received#

V5 ബ്രെയിനിന് അയച്ച സന്ദേശം ലഭിക്കുമ്പോഴെല്ലാം വിളിക്കേണ്ട ഒരു ഫംഗ്ഷൻ രജിസ്റ്റർ ചെയ്യുന്നു.

Available Functions

1 എല്ലാ ലഭിച്ച സന്ദേശങ്ങൾക്കും ഒരു കോൾബാക്ക് രജിസ്റ്റർ ചെയ്യുന്നു (സന്ദേശം + മൂല്യം).

void received(
    void (* callback)(const char *, const char *, double)
);

2 എല്ലാ ലഭിച്ച സന്ദേശങ്ങൾക്കും (സന്ദേശം + സൂചിക + മൂല്യം) ഒരു കോൾബാക്ക് രജിസ്റ്റർ ചെയ്യുന്നു.

void received(
    void (* callback)(const char *, const char *, int32_t, double)
);

3 ഒരു പ്രത്യേക സന്ദേശത്തിനായി (സന്ദേശം + മൂല്യം) ഒരു കോൾബാക്ക് രജിസ്റ്റർ ചെയ്യുന്നു.

void received(
    const char *message,
    void      (* callback)(const char *, const char *, double)
);

4 ഒരു പ്രത്യേക സന്ദേശത്തിനായി (സന്ദേശം + സൂചിക + മൂല്യം) ഒരു കോൾബാക്ക് രജിസ്റ്റർ ചെയ്യുന്നു.

void received(
    const char *message,
    void      (* callback)(const char *, const char *, int32_t, double)
);

Parameters

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

message

const char *

കേൾക്കേണ്ട സന്ദേശത്തിന്റെ പേര്. ഒഴിവാക്കിയാൽ, ലഭിച്ച എല്ലാ സന്ദേശങ്ങൾക്കും കോൾബാക്ക് പ്രവർത്തിക്കും.

callback

void (*)(const char *, const char , double) or void ()(const char *, const char *, int32_t, double)

ഒരു സന്ദേശം ലഭിക്കുമ്പോൾ നടപ്പിലാക്കുന്ന ഒരു ഫംഗ്ഷൻ.

Return Values

ഈ ഫംഗ്ഷൻ ഒരു മൂല്യങ്ങളും തിരികെ നൽകുന്നില്ല.

Callback Signature

1 അയച്ചയാളുടെ പേര്, സന്ദേശത്തിന്റെ പേര്, മൂല്യം എന്നിവ സ്വീകരിക്കുന്നു.

void callback(const char *, const char *, double)

2 അയച്ചയാളുടെ പേര്, സന്ദേശത്തിന്റെ പേര്, സൂചിക, മൂല്യം എന്നിവ സ്വീകരിക്കുന്നു.

void callback(const char *, const char *, int32_t, double)

ടൈപ്പ് ചെയ്യുക

വിവരണം

1st const char *

അയച്ചയാളുടെ ലിങ്ക് പേര്.

2nd const char *

സന്ദേശ നാമം ലഭിച്ചു.

int32_t

സന്ദേശവുമായി ബന്ധപ്പെട്ട സൂചിക.

double

സന്ദേശവുമായി ബന്ധപ്പെട്ട മൂല്യം.

Examples

റോബോട്ട് 1 നുള്ള കോഡ്

// Create the link.
message_link link(PORT1, "LeftRightLink", linkType::manager, true);

// Send whether screen is pressed on left or right.
void screen_pressed() {
  if (Brain.Screen.xPosition() < 240) {
    link.send("left");
  } else {
    link.send("right");
  }
}

int main() {
  /* vexcodeInit() is only required when using VEXcode.
  Remove vexcodeInit() if compiling in VS Code. */
  vexcodeInit();
  
  // Do not run code UNTIL the Brains are linked.
  while (!link.isLinked()) {
    wait(0.1, seconds);
  }

  Brain.Screen.print("Robot 1 - Manager");

  Brain.Screen.pressed(screen_pressed);

  while (true) {
    wait(10, msec);
  }
}

റോബോട്ട് 2 നുള്ള കോഡ്

// Create variable to track where screen is pressed.
int lastPress = 0;

// Update the variable whenever a new message is received.
void message_received(const char* message, const char* linkname, double timestamp) {
  if (strcmp(message, "left") == 0)  lastPress = 1;
  if (strcmp(message, "right") == 0) lastPress = 2;
}

int main() {
  /* vexcodeInit() is only required when using VEXcode.
  Remove vexcodeInit() if compiling in VS Code. */
  vexcodeInit();

  // Create the link.
  message_link link(PORT1, "VEXRoboticsLink123456789", linkType::worker, true);

  // Do not run code UNTIL the Brains are linked.
  while (!link.isLinked()) {
    wait(0.1, seconds);
  }

  link.received(message_received);

  // Display if Robot 1's screen was pressed on the left or right
  while (true) {
    Brain.Screen.clearScreen();
    Brain.Screen.setCursor(1, 1);
    Brain.Screen.print("Robot 2 - Worker");
    Brain.Screen.newLine();

    if (lastPress == 1) {
      Brain.Screen.print("Manager pressed LEFT");
    } else if (lastPress == 2) {
      Brain.Screen.print("Manager pressed RIGHT");
    } else {
      Brain.Screen.print("Waiting...");
    }

    wait(0.1, seconds);
  }
}

previous

VEXലിങ്ക്

next

സീരിയൽ ലിങ്ക്

On this page
  • ആമുഖം
  • ക്ലാസ് കൺസ്ട്രക്‌ടറുകൾ
  • ക്ലാസ് ഡിസ്ട്രക്റ്റർ
  • പാരാമീറ്ററുകൾ
  • ഉദാഹരണം
  • അംഗ പ്രവർത്തനങ്ങൾ
    • isLinked
    • send
    • receive
    • received
Innovation First, International
​

VEX ഉം VEX റോബോട്ടിക്സും ഇന്നൊവേഷൻ ഫസ്റ്റ്, ഇൻ‌കോർപ്പറേറ്റഡിന്റെ വ്യാപാരമുദ്രകളോ സേവന മാർക്കുകളോ ആണ്. പകർപ്പവകാശം ©2026എല്ലാ അവകാശങ്ങളും നിക്ഷിപ്തം. VEX റോബോട്ടിക്സ്, ഇൻ‌കോർപ്പറേറ്റഡ് ഇന്നൊവേഷൻ ഫസ്റ്റ് ഇന്റർനാഷണൽ, ഇൻ‌കോർപ്പറേറ്റഡിന്റെ ഒരു അനുബന്ധ സ്ഥാപനമാണ്. മറ്റുള്ളവരുടെ മറ്റെല്ലാ ഉൽപ്പന്ന നാമങ്ങളും / മാർക്കുകളും അവയുടെ ഉടമസ്ഥരുടെ സ്വത്താണ്. പേറ്റന്റുകളും / അല്ലെങ്കിൽ പേറ്റന്റുകളും തീർപ്പുകൽപ്പിച്ചിട്ടില്ല - innovationfirst.com/patents
സൈറ്റ് സ്വകാര്യതാ നയം / സൈറ്റ് ഉപയോഗ നിബന്ധനകൾ / കുക്കി നയം / സോഫ്റ്റ്‌വെയർ സ്വകാര്യതാ നയം

VEX റോബോട്ടിക്സ് ഫേസ്ബുക്ക് പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് ട്വിറ്റർ പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് ഇൻസ്റ്റാഗ്രാം പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് യൂട്യൂബ് പേജ് സന്ദർശിക്കുക
VEX API ഫീഡ്‌ബാക്ക് ഫോം

നിങ്ങളുടെ ഫീഡ്‌ബാക്കിനെ ഞങ്ങൾ വിലമതിക്കുന്നു! VEX API-യിൽ നിർദ്ദേശങ്ങൾ, അഭിനന്ദനങ്ങൾ അല്ലെങ്കിൽ പിശകുകൾ റിപ്പോർട്ട് ചെയ്യാൻ ഈ ഫോം ഉപയോഗിക്കുക. VEX API ഡോക്യുമെന്റേഷൻ മെച്ചപ്പെടുത്താൻ നിങ്ങളുടെ അഭിപ്രായം ഞങ്ങളെ സഹായിക്കുന്നു.

​

നിങ്ങൾക്ക് സാങ്കേതിക പ്രശ്നങ്ങൾ നേരിടുന്നുണ്ടെങ്കിലോ ഉപഭോക്തൃ പിന്തുണ ആവശ്യമുണ്ടെങ്കിലോ, ദയവായി support.vex.comസന്ദർശിക്കുക.

  • Send Happy Feedback
  • Send Sad Feedback

കുറിപ്പ്: നിലവിലെ URL നിങ്ങളുടെ സന്ദേശവുമായി പങ്കിടും.

നിങ്ങളുടെ ഇമെയിൽ വിലാസം ഉൾപ്പെടുത്തുന്നതിലൂടെ, നിങ്ങളുടെ ഫീഡ്‌ബാക്കിനെക്കുറിച്ച് ഞങ്ങൾക്ക് എന്തെങ്കിലും ചോദ്യങ്ങളുണ്ടെങ്കിൽ VEX നിങ്ങൾക്ക് ഇമെയിൽ ഇമെയിലുകൾ അയച്ചേക്കാമെന്ന് നിങ്ങൾ സമ്മതിക്കുന്നു.
സ്വകാര്യതാ നയം >
ദയവായി നിങ്ങളുടെ ഫീഡ്‌ബാക്ക് നൽകുക. ഫീഡ്‌ബാക്ക് വിജയകരമായി സമർപ്പിച്ചു!
Choose Which VEX IQ Generation to View

VEX IQ (1st gen)

VEX IQ (2nd gen)