AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2mbcontroller.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2mbcontroller.h"
9 #include <sstream>
10 #include <fstream>
11 
12 #if defined(AJALinux)
13 #include <stdlib.h>
14 #endif
15 
16 
17 using namespace std;
18 
20 {
21  ipc_gateway = 0;
22  ipc_ip = 0;
23  ipc_subnet = 0;
24 }
25 
27 {
28  return (!(*this == other));
29 }
30 
32 {
33  if ((ipc_gateway == other.ipc_gateway) &&
34  (ipc_ip == other.ipc_ip) &&
35  (ipc_subnet == other.ipc_subnet))
36  {
37  return true;
38  }
39  else
40  {
41  return false;
42  }
43 }
44 
46 {
47 }
48 
49 bool CNTV2MBController::SetMBNetworkConfiguration (eSFP port, string ipaddr, string netmask, string gateway)
50 {
51  if (!(getFeatures() & SAREK_MB_PRESENT))
52  return true;
53 
54  bool rv = AcquireMailbox();
55  if (!rv) return false;
56 
57  sprintf((char*)txBuf,"cmd=%d,port=%d,ipaddr=%s,subnet=%s,gateway=%s",
58  (int)MB_CMD_SET_NET,(int)port,ipaddr.c_str(),netmask.c_str(),gateway.c_str());
59 
60  rv = sendMsg(5000);
61  if (!rv)
62  {
65  return false;
66  }
67 
68  string response;
69  getResponse(response);
70  vector<string> msg;
71  splitResponse(response, msg);
72  if (msg.size() >=1)
73  {
74  string status;
75  rv = getString(msg[0],"status",status);
76  if (rv && (status == "OK"))
77  {
79  SetSFPActive(port);
80  return true;
81  }
82  else if (rv && (status == "FAIL"))
83  {
84  if (msg.size() >= 3)
85  {
86  rv = getString(msg[2],"error",mIpInternalErrorString);
89  return false;
90  }
91  }
92  }
93 
96  return false;
97 }
98 
100 {
101  if (!(getFeatures() & SAREK_MB_PRESENT))
102  return true;
103 
104  bool rv = AcquireMailbox();
105  if (!rv) return false;
106 
107  sprintf((char*)txBuf,"cmd=%d,port=%d",
108  (int)MB_CMD_DISABLE_NET_IF,(int)port);
109 
110  rv = sendMsg(5000);
111  if (!rv)
112  {
113  ReleaseMailbox();
115  return false;
116  }
117 
118  string response;
119  getResponse(response);
120  vector<string> msg;
121  splitResponse(response, msg);
122  if (msg.size() >=1)
123  {
124  string status;
125  rv = getString(msg[0],"status",status);
126  if (rv && (status == "OK"))
127  {
128  ReleaseMailbox();
129  SetSFPInactive(port);
130  return true;
131  }
132  else if (rv && (status == "FAIL"))
133  {
134  if (msg.size() >= 3)
135  {
136  rv = getString(msg[2],"error",mIpInternalErrorString);
138  ReleaseMailbox();
139  return false;
140  }
141  }
142  }
143 
144  ReleaseMailbox();
146  return false;
147 }
148 
149 bool CNTV2MBController::SetIGMPVersion(uint32_t version)
150 {
151  if (!(getFeatures() & SAREK_MB_PRESENT))
152  return true;
153 
154  sprintf((char*)txBuf,"cmd=%d,version=%d",(int)MB_CMD_SET_IGMP_VERSION,version);
155  bool rv = sendMsg(500);
156  if (!rv)
157  {
159  return false;
160  }
161 
162  string response;
163  getResponse(response);
164  vector<string> msg;
165  splitResponse(response, msg);
166  if (msg.size() >=1)
167  {
168  string status;
169  rv = getString(msg[0],"status",status);
170  if (rv && (status == "OK"))
171  {
172  return true;
173  }
174  else if (rv && (status == "FAIL"))
175  {
176  if (msg.size() >= 3)
177  {
178  rv = getString(msg[2],"error",mIpInternalErrorString);
180  return false;
181  }
182  }
183  }
184 
186  return false;
187 }
188 
189 bool CNTV2MBController::GetRemoteMAC(std::string remote_IPAddress, eSFP port, NTV2Stream stream, string & MACaddress)
190 {
191  if ( (getFeatures() & SAREK_MB_PRESENT) == 0)
192  return true;
193 
194  bool rv = AcquireMailbox();
195  if (!rv) return false;
196 
197  int count = 30;
198  do
199  {
200  rv = SendArpRequest(remote_IPAddress,port);
201  if (!rv) return false;
202 
204  eArpState as = GetRemoteMACFromArpTable(remote_IPAddress, port, stream, MACaddress);
205  switch (as)
206  {
207  case ARP_VALID:
208  ReleaseMailbox();
209  return true;
210  case ARP_ERROR:
211  ReleaseMailbox();
212  return false;
213  default:
214  case ARP_INCOMPLETE:
215  case ARP_NOT_FOUND:
216  break;
217  }
218 
219  } while (--count);
220 
221  ReleaseMailbox();
222  return false;
223 }
224 
225 eArpState CNTV2MBController::GetRemoteMACFromArpTable(std::string remote_IPAddress, eSFP port, NTV2Stream stream, string & MACaddress)
226 {
227  if (!(getFeatures() & SAREK_MB_PRESENT))
228  return ARP_VALID;
229 
230  sprintf(reinterpret_cast<char*>(txBuf), "cmd=%d,ipaddr=%s,port=%d,stream=%d",
232  remote_IPAddress.c_str(),
233  int(port),
234  int(stream));
235  bool rv = sendMsg(500);
236  if (!rv)
237  {
238  return ARP_ERROR;
239  }
240 
241  string response;
242  getResponse(response);
243  vector<string> msg;
244  splitResponse(response, msg);
245  if (msg.size() >=1)
246  {
247  string status;
248  rv = getString(msg[0],"status",status);
249  if (rv && (status == "OK"))
250  {
251  if (msg.size() != 3)
252  {
254  return ARP_ERROR;
255  }
256 
257  rv = getString(msg[2],"MAC",MACaddress);
258  if (rv == false)
259  {
261  return ARP_ERROR;
262  }
263  return ARP_VALID;
264  }
265  else if (rv && (status == "FAIL"))
266  {
267  if (msg.size() >= 4)
268  {
269  uint32_t state;
270  rv = getString(msg[2],"error",mIpInternalErrorString);
271  rv = getDecimal(msg[3],"state",state);
273  return (eArpState)state;
274  }
275  }
276  }
277 
279  return ARP_ERROR;
280 }
281 
282 bool CNTV2MBController::SendArpRequest(std::string remote_IPAddress, eSFP port)
283 {
284  if ( (getFeatures() & SAREK_MB_PRESENT) == 0)
285  return true;
286 
287  sprintf((char*)txBuf,"cmd=%d,ipaddr=%s,port=%d",
288  (int)MB_CMD_SEND_ARP_REQ,
289  remote_IPAddress.c_str(),
290  int(port));
291 
292  bool rv = sendMsg(500);
293  if (!rv)
294  {
295  return ARP_ERROR;
296  }
297 
298  string response;
299  getResponse(response);
300  vector<string> msg;
301  splitResponse(response, msg);
302  if (msg.size() >=1)
303  {
304  string status;
305  rv = getString(msg[0],"status",status);
306  if (rv && (status == "OK"))
307  {
308  if (msg.size() != 2)
309  {
311  return false;
312  }
313  return true;
314  }
315  else if (rv && (status == "FAIL"))
316  {
317  if (msg.size() >= 4)
318  {
319  rv = getString(msg[2],"error",mIpInternalErrorString);
321  return false;
322  }
323  }
324  }
325 
327  return false;
328 }
329 
330 void CNTV2MBController::splitResponse(std::string response, std::vector<std::string> & results)
331 {
332  std::istringstream ss(response);
333  std::string token;
334 
335  while(std::getline(ss, token, ','))
336  {
337  results.push_back(token);
338  }
339 }
340 
341 bool CNTV2MBController::getDecimal(const std::string & resp, const std::string & parm, uint32_t & result)
342 {
343  string val;
344  bool rv = getString(resp,parm,val);
345  if (rv)
346  {
347  result = atoi(val.c_str());
348  return true;
349  }
350  return false;
351 }
352 
353 bool CNTV2MBController::getHex(const std::string & resp, const std::string & parm, uint32_t & result)
354 {
355  string val;
356  bool rv = getString(resp,parm,val);
357  if (rv)
358  {
359  result = uint32_t(::strtoul(val.c_str(),NULL,16));
360  return true;
361  }
362  return false;
363 }
364 
365 bool CNTV2MBController::getString(const std::string & resp, const std::string & parm, std::string & result)
366 {
367  string match = parm + "=";
368 
369  std::string::size_type i = resp.find(match);
370 
371  if (i != std::string::npos && i == 0)
372  {
373  result = resp;
374  result.erase(i, match.length());
375  return true;
376  }
377  return false; // not found
378 }
379 
380 void CNTV2MBController::SetIGMPGroup(eSFP port, NTV2Stream stream, uint32_t mcast_addr, uint32_t src_addr, bool enable)
381 {
382  uint32_t offset = getIGMPCBOffset(port, stream);
386 
387  uint32_t val = IGMPCB_STATE_USED;
388  if (enable)
389  {
390  val += IGMPCB_STATE_ENABLED;
391  }
393 }
394 
396 {
397  uint32_t offset = getIGMPCBOffset(port, stream);
401 
403 }
404 
405 void CNTV2MBController::EnableIGMPGroup(eSFP port, NTV2Stream stream, bool enable)
406 {
407  uint32_t val = 0;
408  uint32_t offset = getIGMPCBOffset(port, stream);
410  if (val != 0)
411  {
412  // is used or busy, so can enable/disable
414  val = IGMPCB_STATE_USED;
415  if (enable)
416  {
417  val += IGMPCB_STATE_ENABLED;
418  }
420  }
421 }
422 
423 uint32_t CNTV2MBController::getIGMPCBOffset(eSFP port, NTV2Stream stream)
424 {
425  struct IGMPCB
426  {
427  uint32_t state;
428  uint32_t multicast_addr;
429  uint32_t source_addr;
430  };
431 
433  {
434  uint32_t index = (int)stream + (NTV2_MAX_NUM_SINGLE_STREAMS * (int)port);
435  uint32_t reg = (index * sizeof(IGMPCB))/4;
436  return reg;
437  }
438  return 0;
439 }
440 
441 bool CNTV2MBController::SetTxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
442 {
443  uint32_t chan = (uint32_t)channel;
444 
445  uint32_t val = 0;
446  if (sfp1Enable) val |= 0x2;
447  if (sfp2Enable) val |= 0x1;
448  val <<= (chan * 2);
449 
450  uint32_t state;
452  if (!rv) return false;
453  state &= ~( 0x3 << (chan * 2) );
454  state |= val;
456  return rv;
457 }
458 
459 bool CNTV2MBController::GetTxLinkState(NTV2Channel channel, bool & sfp1Enable, bool & sfp2Enable)
460 {
461  uint32_t chan = (uint32_t)channel;
462 
463  uint32_t state;
465  if (!rv) return false;
466  state &= ( 0x3 << (chan * 2) );
467  state >>= (chan * 2);
468  sfp1Enable = (state & 0x02) ? true : false;
469  sfp2Enable = (state & 0x01) ? true : false;
470  return true;
471 }
472 
473 
474 bool CNTV2MBController::SetRxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
475 {
476  uint32_t chan = (uint32_t)channel;
477 
478  uint32_t val = 0;
479  if (sfp1Enable) val |= 0x2;
480  if (sfp2Enable) val |= 0x1;
481  val <<= (chan * 2);
482 
483  uint32_t state;
485  if (!rv) return false;
486  state &= ~( (0x3 << (chan * 2)) << 8 );
487  state |= (val << 8);
489  return rv;
490 }
491 
492 bool CNTV2MBController::GetRxLinkState(NTV2Channel channel, bool & sfp1Enable, bool & sfp2Enable)
493 {
494  uint32_t chan = (uint32_t)channel;
495 
496  uint32_t state;
498  if (!rv) return false;
499  state >>= 8;
500  state &= ( 0x3 << (chan * 2) );
501  state >>= (chan * 2);
502  sfp1Enable = (state & 0x02) ? true : false;
503  sfp2Enable = (state & 0x01) ? true : false;
504  return true;
505 }
506 
507 bool CNTV2MBController::SetRxMatch(NTV2Channel channel, eSFP link, uint8_t match)
508 {
509  uint32_t chan = (uint32_t)channel;
510 
511  uint32_t val;
512  if (link == SFP_1)
513  {
515  }
516  else
517  {
519  }
520 
521  val &= ~( 0xff << (chan * 8));
522  val |= ( match << (chan * 8) );
523 
524  if (link == SFP_1)
525  {
527  }
528  else
529  {
531  }
532  return true;
533 }
534 
535 bool CNTV2MBController::GetRxMatch(NTV2Channel channel, eSFP link, uint8_t & match)
536 {
537  uint32_t chan = (uint32_t)channel;
538 
539  uint32_t val;
540  if (link == SFP_1)
541  {
543  }
544  else
545  {
547  }
548 
549  val >>= (chan * 8);
550  val &= 0xff;
551  match = (uint8_t)val;
552  return true;
553 }
554 
555 
557 {
558  uint32_t state;
560  if (sfp == SFP_2)
561  {
562  state |= S2022_LINK_B_ACTIVE;
563  }
564  else
565  {
566  state |= S2022_LINK_A_ACTIVE;
567  }
569  return true;
570 }
571 
573 {
574  uint32_t state;
576  if (sfp == SFP_2)
577  {
578  state &= ~S2022_LINK_B_ACTIVE;
579  }
580  else
581  {
582  state &= ~S2022_LINK_A_ACTIVE;
583  }
585  return true;
586 }
587 
588 
590 {
591  uint32_t state;
593  if (sfp == SFP_2)
594  {
595  if (state & S2022_LINK_B_ACTIVE)
596  return true;
597  }
598  else
599  {
600  if (state & S2022_LINK_A_ACTIVE)
601  return true;
602  }
603  return false;
604 }
605 
607 {
608  uint32_t state;
610  if (enable)
611  {
612  state |= S2022_DUAL_LINK;
613  }
614  else
615  {
616  state &= ~S2022_DUAL_LINK;
617  }
619  return true;
620 }
621 
623 {
624  uint32_t state;
626  enable = ((state & S2022_DUAL_LINK) != 0);
627  return true;
628 }
629 
630 
632 {
633  uint32_t shift = 8 * (int)chan;
634  uint32_t state;
636  state &= ~(0xff << shift);
637  state |= (uint8_t(fmt) << shift );
639  return true;
640 }
641 
643 {
644  uint32_t shift = 8 * (int)chan;
645  uint32_t state;
647  state &= (0xff << shift);
648  state >>= shift;
649  fmt = (NTV2VideoFormat)state;
650  return true;
651 }
652 
653 
655 {
656  uint32_t secsLo;
657  uint32_t nanosecs;
660 
661  uint64_t res = secsLo;
662  res = (res << 32) + nanosecs;
663  return res;
664 }
665 
666 
667 bool CNTV2MBController::PushSDP(string filename, stringstream & sdpstream)
668 {
669  if (!(getFeatures() & SAREK_MB_PRESENT))
670  return true;
671 
672  string sdp = sdpstream.str();
673 
674  string from = ",";
675  string to = "&comma;";
676  size_t start_pos = 0;
677  while((start_pos = sdp.find(from, start_pos)) != std::string::npos)
678  {
679  sdp.replace(start_pos, from.length(), to);
680  start_pos += to.length();
681  }
682 
683  int size = (int)sdp.size();
684  if (size >= ((FIFO_SIZE*4)-128))
685  {
687  return false;
688  }
689 
690  sprintf((char*)txBuf,"cmd=%d,name=%s,sdp=%s",(int)MB_CMD_TAKE_SDP,filename.c_str(),sdp.c_str());
691  bool rv = sendMsg(500);
692  if (!rv)
693  {
695  return false;
696  }
697 
698  string response;
699  getResponse(response);
700  vector<string> msg;
701  splitResponse(response, msg);
702  if (msg.size() >=1)
703  {
704  string status;
705  rv = getString(msg[0],"status",status);
706  if (rv && (status == "OK"))
707  {
708  return true;
709  }
710  else if (rv && (status == "FAIL"))
711  {
712  if (msg.size() >= 3)
713  {
714  rv = getString(msg[2],"error",mIpInternalErrorString);
716  return false;
717  }
718  }
719  }
720 
722  return false;
723 }
724 
725  bool CNTV2MBController::GetSDP(string url, string & sdp)
726  {
727  if (!(getFeatures() & SAREK_MB_PRESENT))
728  return true;
729 
730  if (url.empty())
731  {
733  return false;
734  }
735 
736  sprintf((char*)txBuf,"cmd=%d,URL=%s",(int)MB_CMD_FETCH_SDP,url.c_str());
737  bool rv = sendMsg(5000);
738  if (!rv)
739  {
741  return false;
742  }
743 
744  string response;
745  getResponse(response);
746  vector<string> msg;
747  splitResponse(response, msg);
748  if (msg.size() >=3)
749  {
750  string status;
751  rv = getString(msg[0],"status",status);
752  if (rv && (status == "OK"))
753  {
754  rv = getString(msg[2],"SDP",sdp);
755  if (rv == false)
756  {
758  return false;
759  }
760  string to = ",";
761  string from = "&comma;";
762  size_t start_pos = 0;
763  while((start_pos = sdp.find(from, start_pos)) != std::string::npos)
764  {
765  sdp.replace(start_pos, from.length(), to);
766  start_pos += to.length();
767  }
768  return true;
769  }
770  else if (rv && (status == "FAIL"))
771  {
772  if (msg.size() >= 3)
773  {
774  rv = getString(msg[2],"error",mIpInternalErrorString);
776  return false;
777  }
778  }
779  }
780 
782  return false;
783  }
784 
786  {
787  if (!(getFeatures() & SAREK_MB_PRESENT))
788  return true;
789 
790  sprintf((char*)txBuf,"cmd=%d,port=%d",(int)MB_CMD_FETCH_SFP_INFO,(int)port);
791  bool rv = sendMsg(5000);
792  if (!rv)
793  {
795  return false;
796  }
797 
798  string response;
799  getResponse(response);
800  vector<string> msg;
801  splitResponse(response, msg);
802  if (msg.size() >=3)
803  {
804  string status;
805  rv = getString(msg[0],"status",status);
806  if (rv && (status == "OK"))
807  {
808  string info;
809  rv = getString(msg[2],"SFP",info);
810  if (rv == false)
811  {
813  return false;
814  }
815  if (info.size() != 129)
816  {
818  return false;
819  }
820  int j = 0;
821  for (int i=0; i < 128; i+=2)
822  {
823  char buf[3];
824  char * end;
825  memset(buf,0,3);
826  buf[0] = info[i];
827  buf[1] = info[i+1];
828  uint8_t val = (uint8_t)strtol(buf,&end,16);
829  sfpdata.data[j++]= val;
830  }
831  return true;
832  }
833  else if (rv && (status == "FAIL"))
834  {
835  if (msg.size() >= 3)
836  {
837  rv = getString(msg[2],"error",mIpInternalErrorString);
839  return false;
840  }
841  }
842  }
843 
845  return false;
846  }
847 
848 bool CNTV2MBController::GetLLDPInfo(std::string &chassisId0, std::string &portId0,
849  std::string &chassisId1, std::string &portId1)
850 {
851  if (!(getFeatures() & SAREK_MB_PRESENT))
852  return true;
853 
854  sprintf((char*)txBuf,"cmd=%d",(int)MB_CMD_GET_LLDP_INFO);
855  bool rv = sendMsg(5000);
856  if (!rv)
857  {
859  return false;
860  }
861 
862  string response;
863  getResponse(response);
864  vector<string> msg;
865  splitResponse(response, msg);
866  if (msg.size() >=6)
867  {
868  string status;
869  rv = getString(msg[0],"status",status);
870  if (rv && (status == "OK"))
871  {
872  rv = getString(msg[2],"chassisId0",chassisId0);
873  if (rv == false)
874  {
876  return false;
877  }
878  rv = getString(msg[3],"portId0",portId0);
879  if (rv == false)
880  {
882  return false;
883  }
884  rv = getString(msg[4],"chassisId1",chassisId1);
885  if (rv == false)
886  {
888  return false;
889  }
890  rv = getString(msg[5],"portId1",portId1);
891  if (rv == false)
892  {
894  return false;
895  }
896  return true;
897  }
898  else if (rv && (status == "FAIL"))
899  {
900  if (msg.size() >= 3)
901  {
902  rv = getString(msg[2],"error",mIpInternalErrorString);
904  return false;
905  }
906  }
907  }
908 
910  return false;
911 }
912 
913 bool CNTV2MBController::SetLLDPInfo(string sysName)
914 {
915  if (!(getFeatures() & SAREK_MB_PRESENT))
916  return true;
917 
918  bool rv = AcquireMailbox();
919  if (!rv) return false;
920 
921  sprintf((char*)txBuf,"cmd=%d,sysName=%s", (int)MB_CMD_SET_LLDP_INFO,
922  sysName.c_str());
923 
924  rv = sendMsg(5000);
925  if (!rv)
926  {
927  ReleaseMailbox();
929  return false;
930  }
931 
932  string response;
933  getResponse(response);
934  vector<string> msg;
935  splitResponse(response, msg);
936  if (msg.size() >=1)
937  {
938  string status;
939  rv = getString(msg[0],"status",status);
940  if (rv && (status == "OK"))
941  {
942  ReleaseMailbox();
943  return true;
944  }
945  else if (rv && (status == "FAIL"))
946  {
947  if (msg.size() >= 3)
948  {
949  rv = getString(msg[2],"error",mIpInternalErrorString);
951  ReleaseMailbox();
952  return false;
953  }
954  }
955  }
956 
957  ReleaseMailbox();
959  return false;
960 }
961 
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail2::end
end_tag end(T &&...)
NTV2IpErrLLDPNotFound
@ NTV2IpErrLLDPNotFound
Definition: ntv2enums.h:4305
CNTV2MBController::SetIGMPGroup
void SetIGMPGroup(eSFP port, NTV2Stream stream, uint32_t mcast_addr, uint32_t src_addr, bool enable)
Definition: ntv2mbcontroller.cpp:380
IGMP_BLOCK_BASE
#define IGMP_BLOCK_BASE
Definition: ntv2registersmb.h:121
eSFP
eSFP
Definition: ntv2mbcontroller.h:38
IPVNetConfig::ipc_ip
uint32_t ipc_ip
Definition: ntv2mbcontroller.h:123
CNTV2MailBox::getFeatures
uint32_t getFeatures()
Definition: ntv2mailbox.cpp:406
kRegSarekLinkModes
#define kRegSarekLinkModes
Definition: ntv2registersmb.h:99
IGMPCB_REG_SRC_ADDR
#define IGMPCB_REG_SRC_ADDR
Definition: ntv2mbcontroller.h:102
NTV2IpErrSDPURLInvalid
@ NTV2IpErrSDPURLInvalid
Definition: ntv2enums.h:4299
SAREK_REGS2
#define SAREK_REGS2
Definition: ntv2registersmb.h:58
CNTV2MailBox::mDevice
CNTV2Card & mDevice
Definition: ntv2mailbox.h:79
CNTV2MacDriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2macdriverinterface.cpp:389
NTV2IpErrSFPNotFound
@ NTV2IpErrSFPNotFound
Definition: ntv2enums.h:4303
CNTV2MBController::UnsetIGMPGroup
void UnsetIGMPGroup(eSFP port, NTV2Stream stream)
Definition: ntv2mbcontroller.cpp:395
NULL
#define NULL
Definition: ntv2caption608types.h:19
NTV2IpErrMBStatusFail
@ NTV2IpErrMBStatusFail
Definition: ntv2enums.h:4293
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1334
NTV2IpErrSDPNotFound
@ NTV2IpErrSDPNotFound
Definition: ntv2enums.h:4296
SFPMSAData::data
uint8_t data[64]
Definition: ntv2mbcontroller.h:70
CNTV2MBController::GetRemoteMAC
bool GetRemoteMAC(std::string remote_IPAddress, eSFP port, NTV2Stream stream, std::string &MACaddress)
Definition: ntv2mbcontroller.cpp:189
SAREK_PLL
#define SAREK_PLL
Definition: ntv2registersmb.h:57
CNTV2MBController::SetRxMatch
bool SetRxMatch(NTV2Channel channel, eSFP link, uint8_t match)
Definition: ntv2mbcontroller.cpp:507
MB_CMD_GET_MAC_FROM_ARP_TABLE
@ MB_CMD_GET_MAC_FROM_ARP_TABLE
Definition: ntv2mbcontroller.h:19
FIFO_SIZE
#define FIFO_SIZE
Definition: ntv2mailbox.h:36
kRegPll_PTP_CurPtpSecLo
#define kRegPll_PTP_CurPtpSecLo
Definition: ntv2registersmb.h:416
CNTV2MBController::GetLLDPInfo
bool GetLLDPInfo(std::string &chassisId0, std::string &portId0, std::string &chassisId1, std::string &portId1)
Definition: ntv2mbcontroller.cpp:848
ARP_INCOMPLETE
@ ARP_INCOMPLETE
Definition: ntv2mbcontroller.h:52
MB_CMD_SEND_ARP_REQ
@ MB_CMD_SEND_ARP_REQ
Definition: ntv2mbcontroller.h:20
CNTV2MailBox::AcquireMailbox
bool AcquireMailbox()
Definition: ntv2mailbox.cpp:270
IPVNetConfig::operator!=
bool operator!=(const IPVNetConfig &other)
Definition: ntv2mbcontroller.cpp:26
CNTV2MBController::GetRxLinkState
bool GetRxLinkState(NTV2Channel channel, bool &sfp1Enable, bool &sfp2Enable)
Definition: ntv2mbcontroller.cpp:492
MB_CMD_FETCH_SFP_INFO
@ MB_CMD_FETCH_SFP_INFO
Definition: ntv2mbcontroller.h:27
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1336
CNTV2MBController::GetRxMatch
bool GetRxMatch(NTV2Channel channel, eSFP link, uint8_t &match)
Definition: ntv2mbcontroller.cpp:535
IPVNetConfig::operator==
bool operator==(const IPVNetConfig &other)
Definition: ntv2mbcontroller.cpp:31
MB_CMD_SET_IGMP_VERSION
@ MB_CMD_SET_IGMP_VERSION
Definition: ntv2mbcontroller.h:22
kRegPll_PTP_CurPtpNSec
#define kRegPll_PTP_CurPtpNSec
Definition: ntv2registersmb.h:417
MB_CMD_SET_NET
@ MB_CMD_SET_NET
Definition: ntv2mbcontroller.h:18
kRegSarekRxMatchesA
#define kRegSarekRxMatchesA
Definition: ntv2registersmb.h:100
kRegSarekTxFmts
#define kRegSarekTxFmts
Definition: ntv2registersmb.h:102
S2022_LINK_A_ACTIVE
#define S2022_LINK_A_ACTIVE
Definition: ntv2mbcontroller.h:109
SFP_1
@ SFP_1
Definition: ntv2mbcontroller.h:40
CNTV2MBController::GetDualLinkMode
bool GetDualLinkMode(bool &enable)
Definition: ntv2mbcontroller.cpp:622
CNTV2MailBox::txBuf
uint32_t txBuf[1024+1]
Definition: ntv2mailbox.h:100
CNTV2MBController::DisableNetworkInterface
bool DisableNetworkInterface(eSFP port)
Definition: ntv2mbcontroller.cpp:99
CNTV2MBController::SetIGMPVersion
bool SetIGMPVersion(uint32_t version)
Definition: ntv2mbcontroller.cpp:149
CNTV2MailBox::mIpInternalErrorString
std::string mIpInternalErrorString
Definition: ntv2mailbox.h:82
NTV2IpErrInvalidMBResponseNoMac
@ NTV2IpErrInvalidMBResponseNoMac
Definition: ntv2enums.h:4292
MB_CMD_DISABLE_NET_IF
@ MB_CMD_DISABLE_NET_IF
Definition: ntv2mbcontroller.h:26
CNTV2MBController::GetSFPActive
bool GetSFPActive(eSFP sfp)
Definition: ntv2mbcontroller.cpp:589
kRegSarekRxMatchesB
#define kRegSarekRxMatchesB
Definition: ntv2registersmb.h:101
CNTV2MBController::SetTxLinkState
bool SetTxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
Definition: ntv2mbcontroller.cpp:441
IGMPCB_REG_MCAST_ADDR
#define IGMPCB_REG_MCAST_ADDR
Definition: ntv2mbcontroller.h:101
NTV2IpErrSDPTooLong
@ NTV2IpErrSDPTooLong
Definition: ntv2enums.h:4295
SAREK_REGS
#define SAREK_REGS
Definition: ntv2registersmb.h:54
ARP_NOT_FOUND
@ ARP_NOT_FOUND
Definition: ntv2mbcontroller.h:53
ARP_VALID
@ ARP_VALID
Definition: ntv2mbcontroller.h:51
CNTV2MBController::SetSFPActive
bool SetSFPActive(eSFP sfp)
Definition: ntv2mbcontroller.cpp:556
S2022_LINK_B_ACTIVE
#define S2022_LINK_B_ACTIVE
Definition: ntv2mbcontroller.h:110
CNTV2MBController::SetLLDPInfo
bool SetLLDPInfo(std::string sysname)
Definition: ntv2mbcontroller.cpp:913
SFPMSAData
Definition: ntv2mbcontroller.h:68
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2_MAX_NUM_SINGLE_STREAMS
@ NTV2_MAX_NUM_SINGLE_STREAMS
Definition: ntv2enums.h:1397
NTV2IpErrInvalidMBResponse
@ NTV2IpErrInvalidMBResponse
Definition: ntv2enums.h:4290
ARP_ERROR
@ ARP_ERROR
Definition: ntv2mbcontroller.h:50
IGMPCB_STATE_ENABLED
#define IGMPCB_STATE_ENABLED
Definition: ntv2mbcontroller.h:106
CNTV2MBController::GetSDP
bool GetSDP(std::string url, std::string &sdp)
Definition: ntv2mbcontroller.cpp:725
CNTV2MailBox::mIpErrorCode
NTV2IpError mIpErrorCode
Definition: ntv2mailbox.h:81
NTV2Stream
NTV2Stream
Identifies a specific IP-based data stream.
Definition: ntv2enums.h:1382
CNTV2MBController::SetDualLinkMode
bool SetDualLinkMode(bool enable)
Definition: ntv2mbcontroller.cpp:606
CNTV2MBController::GetNTPTimestamp
uint64_t GetNTPTimestamp()
Definition: ntv2mbcontroller.cpp:654
NTV2IpErrNoResponseFromMB
@ NTV2IpErrNoResponseFromMB
Definition: ntv2enums.h:4288
CNTV2MBController::PushSDP
bool PushSDP(std::string filename, std::stringstream &sdpstream)
Definition: ntv2mbcontroller.cpp:667
CNTV2MailBox::sendMsg
bool sendMsg(char *msg, uint32_t timeout)
Definition: ntv2mailbox.cpp:94
CNTV2MailBox::getResponse
void getResponse(std::string &response)
Definition: ntv2mailbox.cpp:301
S2022_DUAL_LINK
#define S2022_DUAL_LINK
Definition: ntv2mbcontroller.h:111
CNTV2MBController::GetSFPInfo
bool GetSFPInfo(eSFP port, SFPMSAData &sfpdata)
Definition: ntv2mbcontroller.cpp:785
CNTV2MBController::GetTxLinkState
bool GetTxLinkState(NTV2Channel channel, bool &sfp1Enable, bool &sfp2Enable)
Definition: ntv2mbcontroller.cpp:459
SFP_2
@ SFP_2
Definition: ntv2mbcontroller.h:41
MB_CMD_GET_LLDP_INFO
@ MB_CMD_GET_LLDP_INFO
Definition: ntv2mbcontroller.h:29
CNTV2MBController::SetTxFormat
bool SetTxFormat(NTV2Channel chan, NTV2VideoFormat fmt)
Definition: ntv2mbcontroller.cpp:631
CNTV2MBController::CNTV2MBController
CNTV2MBController(CNTV2Card &device)
Definition: ntv2mbcontroller.cpp:45
IPVNetConfig::ipc_subnet
uint32_t ipc_subnet
Definition: ntv2mbcontroller.h:124
NTV2_IS_VALID_SFP
#define NTV2_IS_VALID_SFP(__sfp__)
Definition: ntv2mbcontroller.h:46
CNTV2Card::WaitForOutputVerticalInterrupt
virtual bool WaitForOutputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
Definition: ntv2subscriptions.cpp:134
NTV2IpErrInvalidMBResponseSize
@ NTV2IpErrInvalidMBResponseSize
Definition: ntv2enums.h:4291
std
Definition: json.hpp:5362
IPVNetConfig
Definition: ntv2mbcontroller.h:113
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
eArpState
eArpState
Definition: ntv2mbcontroller.h:48
ntv2mbcontroller.h
Declares the CNTV2MBController class.
CNTV2MBController::GetTxFormat
bool GetTxFormat(NTV2Channel chan, NTV2VideoFormat &fmt)
Definition: ntv2mbcontroller.cpp:642
IGMPCB_STATE_BUSY
#define IGMPCB_STATE_BUSY
Definition: ntv2mbcontroller.h:107
NTV2_IS_VALID_RX_SINGLE_STREAM
#define NTV2_IS_VALID_RX_SINGLE_STREAM(__x__)
Definition: ntv2enums.h:1420
IPVNetConfig::init
void init()
Definition: ntv2mbcontroller.cpp:19
SAREK_MB_PRESENT
#define SAREK_MB_PRESENT
Definition: ntv2registersmb.h:200
CNTV2MBController::SetMBNetworkConfiguration
bool SetMBNetworkConfiguration(eSFP port, std::string ipaddr, std::string netmask, std::string gateway)
Definition: ntv2mbcontroller.cpp:49
IGMPCB_STATE_USED
#define IGMPCB_STATE_USED
Definition: ntv2mbcontroller.h:105
CNTV2MBController::EnableIGMPGroup
void EnableIGMPGroup(eSFP port, NTV2Stream stream, bool enable)
Definition: ntv2mbcontroller.cpp:405
MB_CMD_SET_LLDP_INFO
@ MB_CMD_SET_LLDP_INFO
Definition: ntv2mbcontroller.h:28
CNTV2MailBox
Definition: ntv2mailbox.h:42
CNTV2MBController::SetSFPInactive
bool SetSFPInactive(eSFP sfp)
Definition: ntv2mbcontroller.cpp:572
MB_CMD_TAKE_SDP
@ MB_CMD_TAKE_SDP
Definition: ntv2mbcontroller.h:24
MB_CMD_FETCH_SDP
@ MB_CMD_FETCH_SDP
Definition: ntv2mbcontroller.h:25
IPVNetConfig::ipc_gateway
uint32_t ipc_gateway
Definition: ntv2mbcontroller.h:125
CNTV2MacDriverInterface::WriteRegister
virtual bool WriteRegister(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) on th...
Definition: ntv2macdriverinterface.cpp:430
IGMPCB_REG_STATE
#define IGMPCB_REG_STATE
Definition: ntv2mbcontroller.h:100
CNTV2MBController::SetRxLinkState
bool SetRxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable)
Definition: ntv2mbcontroller.cpp:474
CNTV2MailBox::ReleaseMailbox
void ReleaseMailbox()
Definition: ntv2mailbox.cpp:291