@@ -44,28 +44,28 @@ static constexpr char kStart[] = "{\"status\":{\"update\":\"change\",\"state\":\
4444static constexpr char kDiscoverReply [] = " {\" status\" :{\" man\" :\" %s\" ,\" mod\" :\" Pixel\" ,\" ver\" :\" 1.0\" ,\" mac\" :\" %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\" }}" ;
4545static constexpr char kConfigReply [] =
4646 " {\" config\" :{\" ip\" :\" %d.%d.%d.%d\" ,\" nm\" :\" %d.%d.%d.%d\" ,\" gw\" :\" %d.%d.%d.%d\" ,\" ports\" :["
47- " {\" port\" :\" 0\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
48- " {\" port\" :\" 1\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
49- " {\" port\" :\" 2\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
50- " {\" port\" :\" 3\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
47+ " {\" port\" :\" 0\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
48+ " {\" port\" :\" 1\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
49+ " {\" port\" :\" 2\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
50+ " {\" port\" :\" 3\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
5151#if CONFIG_DMXNODE_PIXEL_MAX_PORTS > 2
52- " {\" port\" :\" 4\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
53- " {\" port\" :\" 5\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
54- " {\" port\" :\" 6\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
55- " {\" port\" :\" 7\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
56- " {\" port\" :\" 8\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
57- " {\" port\" :\" 9\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" }"
52+ " {\" port\" :\" 4\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
53+ " {\" port\" :\" 5\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
54+ " {\" port\" :\" 6\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
55+ " {\" port\" :\" 7\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
56+ " {\" port\" :\" 8\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
57+ " {\" port\" :\" 9\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" }"
5858#endif
5959#if CONFIG_DMXNODE_PIXEL_MAX_PORTS == 16
6060 " ,"
61- " {\" port\" :\" 10\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
62- " {\" port\" :\" 11\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
63- " {\" port\" :\" 12\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
64- " {\" port\" :\" 13\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
65- " {\" port\" :\" 14\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
66- " {\" port\" :\" 15\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
67- " {\" port\" :\" 16\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" },"
68- " {\" port\" :\" 17\" ,\" ts\" :\" 0\" ,\" l\" :\" %d \" ,\" ss\" :\" 0\" }"
61+ " {\" port\" :\" 10\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
62+ " {\" port\" :\" 11\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
63+ " {\" port\" :\" 12\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
64+ " {\" port\" :\" 13\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
65+ " {\" port\" :\" 14\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
66+ " {\" port\" :\" 15\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
67+ " {\" port\" :\" 16\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" },"
68+ " {\" port\" :\" 17\" ,\" ts\" :\" 0\" ,\" l\" :\" %u \" ,\" ss\" :\" 0\" }"
6969
7070#endif
7171 " ]}}" ;
@@ -180,15 +180,15 @@ void DdpDisplay::HandleQuery() {
180180
181181 const auto kLength =
182182 static_cast <uint32_t >(snprintf (reinterpret_cast <char *>(packet->data ), network::udp::kDataSize - 1 , json::kConfigReply , IP2STR (network::GetPrimaryIp ()), IP2STR (network::GetNetmask ()), IP2STR (network::GetGatewayIp ()),
183- active_ports_ > 0 ? count_ : 0 , active_ports_ > 1 ? count_ : 0 ,
183+ active_ports_ > 0 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 1 ? static_cast < unsigned >( count_) : 0 ,
184184#if CONFIG_DMXNODE_PIXEL_MAX_PORTS > 2
185- active_ports_ > 2 ? count_ : 0 , active_ports_ > 3 ? count_ : 0 , active_ports_ > 4 ? count_ : 0 , active_ports_ > 5 ? count_ : 0 , active_ports_ > 6 ? count_ : 0 , active_ports_ > 7 ? count_ : 0 ,
185+ active_ports_ > 2 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 3 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 4 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 5 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 6 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 7 ? static_cast < unsigned >( count_) : 0 ,
186186#endif
187187#if CONFIG_DMXNODE_PIXEL_MAX_PORTS == 16
188- active_ports_ > 8 ? count_ : 0 , active_ports_ > 9 ? count_ : 0 , active_ports_ > 10 ? count_ : 0 , active_ports_ > 11 ? count_ : 0 , active_ports_ > 12 ? count_ : 0 , active_ports_ > 13 ? count_ : 0 ,
189- active_ports_ > 14 ? count_ : 0 , active_ports_ > 15 ? count_ : 0 ,
188+ active_ports_ > 8 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 9 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 10 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 11 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 12 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 13 ? static_cast < unsigned >( count_) : 0 ,
189+ active_ports_ > 14 ? static_cast < unsigned >( count_) : 0 , active_ports_ > 15 ? static_cast < unsigned >( count_) : 0 ,
190190#endif
191- ddpdisplay::configuration::dmx::kMaxPorts == 0 ? 0 : dmxnode::kUniverseSize , ddpdisplay::configuration::dmx::kMaxPorts == 0 ? 0 : dmxnode::kUniverseSize ));
191+ ddpdisplay::configuration::dmx::kMaxPorts == 0 ? 0 : static_cast < unsigned >( dmxnode::kUniverseSize ) , ddpdisplay::configuration::dmx::kMaxPorts == 0 ? 0 : static_cast < unsigned >( dmxnode::kUniverseSize ) ));
192192
193193 packet->header .flags1 = ddp::flags1::VER1 | ddp::flags1::REPLY | ddp::flags1::PUSH ;
194194 packet->header .len [0 ] = static_cast <uint8_t >(kLength >> 8 );
0 commit comments