Skip to content

Commit

Permalink
test for raylocate
Browse files Browse the repository at this point in the history
  • Loading branch information
douwefokkema committed Oct 12, 2024
1 parent 361a3c4 commit 45269d4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/raymarine/RaymarineLocate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ void RaymarineLocate::UpdateEthernetCards() {
m_interface_addr[i].port = 0;
wxLogError(wxT("Attempting to start receive socket on %s"), reportRaymarineCommon.to_string());
m_socket[i] = startUDPMulticastReceiveSocket(m_interface_addr[i], reportRaymarineCommon, error);
LOG_VERBOSE(wxT("RaymarineLocate scanning interface %s for radars"), m_interface_addr[i].FormatNetworkAddress());
LOG_INFO(wxT("RaymarineLocate scanning interface %s for radars"), m_interface_addr[i].FormatNetworkAddress());
i++;

m_interface_addr[i].addr = sa->sin_addr;
m_interface_addr[i].port = 0;
wxLogError(wxT("Attempting to start receive socket on %s"), reportRaymarineQuantumWiFi.to_string());
m_socket[i] = startUDPMulticastReceiveSocket(m_interface_addr[i], reportRaymarineQuantumWiFi, error);
LOG_VERBOSE(wxT("RaymarineLocate scanning interface %s for radars"), m_interface_addr[i].FormatNetworkAddress());
LOG_INFO(wxT("RaymarineLocate scanning interface %s for radars"), m_interface_addr[i].FormatNetworkAddress());
i++;
}
}
Expand Down Expand Up @@ -169,6 +169,7 @@ void *RaymarineLocate::Entry(void) {
NetworkAddress radar_address;
radar_address.addr = rx_addr.ipv4.sin_addr;
radar_address.port = rx_addr.ipv4.sin_port;
LOG_INFO(wxT("$$$ locate receiving r=%i, i=%i"), r, i);
if (ProcessReport(radar_address, m_interface_addr[i], data, (size_t)r)) {
rescan_network_cards = -PERIOD_UNTIL_CARD_REFRESH; // Give double time until we rescan
success = true;
Expand Down Expand Up @@ -226,10 +227,15 @@ bool RaymarineLocate::ProcessReport(const NetworkAddress &radar_address, const N
break;
}
}
if (len == sizeof(LocationInfoBlock) && rRec->model_id == raymarine_radar_code) { // only length 36 is used
if (m_pi->m_settings.verbose >= 2) {
LOG_BINARY_RECEIVE(wxT("RaymarineLocate received RadarReport"), report, len);
if (len == sizeof(LocationInfoBlock)){
LOG_INFO(wxT("$$$ locate process len=%i, report model_id =%0x, raymarine_radar_code=%0x"), len, rRec->model_id,
raymarine_radar_code);
m_pi->logBinaryData(wxT("RaymarineLocate received RadarReport"), report, len);
}
if (len == sizeof(LocationInfoBlock) && rRec->model_id == raymarine_radar_code) { // only length 36 is used




RadarLocationInfo infoA;
NetworkAddress radar_ipA = radar_address;
Expand Down

0 comments on commit 45269d4

Please sign in to comment.