Move MATTER_PORT outside of STD-only udp module

This commit is contained in:
ivmarkov 2023-05-04 12:37:21 +00:00
parent d48b97d77f
commit f89f77c3f3
3 changed files with 5 additions and 8 deletions

View file

@ -58,7 +58,7 @@ fn main() -> Result<(), impl Error> {
let mut mdns = matter::mdns::libmdns::LibMdns::new()?; let mut mdns = matter::mdns::libmdns::LibMdns::new()?;
//let mut mdns = matter::mdns::DummyMdns {}; //let mut mdns = matter::mdns::DummyMdns {};
let matter = Matter::new_default(&dev_info, &mut mdns, matter::transport::udp::MATTER_PORT); let matter = Matter::new_default(&dev_info, &mut mdns, matter::MATTER_PORT);
let dev_att = dev_att::HardCodedDevAtt::new(); let dev_att = dev_att::HardCodedDevAtt::new();

View file

@ -28,6 +28,9 @@ use crate::{
utils::{epoch::Epoch, rand::Rand}, utils::{epoch::Epoch, rand::Rand},
}; };
/* The Matter Port */
pub const MATTER_PORT: u16 = 5540;
/// Device Commissioning Data /// Device Commissioning Data
pub struct CommissioningData { pub struct CommissioningData {
/// The data like password or verifier that is required to authenticate /// The data like password or verifier that is required to authenticate

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
use crate::error::*; use crate::{error::*, MATTER_PORT};
use log::{info, warn}; use log::{info, warn};
use smol::net::{Ipv6Addr, UdpSocket}; use smol::net::{Ipv6Addr, UdpSocket};
@ -27,12 +27,6 @@ pub struct UdpListener {
socket: UdpSocket, socket: UdpSocket,
} }
// Currently matches with the one in connectedhomeip repo
pub const MAX_RX_BUF_SIZE: usize = 1583;
/* The Matter Port */
pub const MATTER_PORT: u16 = 5540;
impl UdpListener { impl UdpListener {
pub async fn new() -> Result<UdpListener, Error> { pub async fn new() -> Result<UdpListener, Error> {
let listener = UdpListener { let listener = UdpListener {