pub fn register_device_change_callback_with_host(
        addr: IpAddr,
        callback: fn(DeviceChangeEvent),
    ) {
        Monome::register_device_change_callback_with_host_and_port(addr, SERIALOSC_PORT, callback)
    }
/// Register for device added/removed notifications, on the default serialosc port, passing in
/// the address at which serialoscd is reachable.
///
/// # Arguments
///
/// - `addr`: the address on which serialoscd is reachable.
/// - `callback`: a function that is called whenever a device is added or removed.
///
/// # Example
///
/// ```no_run
/// # use monome::Monome;
/// # use monome::DeviceChangeEvent;
/// Monome::register_device_change_callback_with_host("192.168.1.12".parse().unwrap(), |event| {
///     match event {
///         DeviceChangeEvent::Added(id) => {
///             println!("Device {} added", id);
///         }
///         DeviceChangeEvent::Removed(id) => {
///             println!("Device {} removed", id);
///         }
///     }
/// });
/// ```
Register for device added/removed notifications, on the default serialosc port, passing in
the address at which serialoscd is reachable.
Register for device added / removed notifications on the default serialosc port passing in the address at which serialoscd is reachable .
pub fn register_device_change_callback_with_host(
        addr: IpAddr,
        callback: fn(DeviceChangeEvent),
    ) {
        Monome::register_device_change_callback_with_host_and_port(addr, SERIALOSC_PORT, callback)
    }
pub fn register_device_change_callback_with_host ( addr : IpAddr , callback : fn ( DeviceChangeEvent ) , ) { Monome :: register_device_change_callback_with_host_and_port ( addr , SERIALOSC_PORT , callback ) }
Register for device added/removed notifications, on the default serialosc port, passing in
the address at which serialoscd is reachable.
Register for device added / removed notifications on the default serialosc port passing in the address at which serialoscd is reachable .
addr
IpAddr
callback
fn(DeviceChangeEvent)
addr
IpAddr
the address on which serialoscd is reachable.
the address on which serialoscd is reachable .
callback
fn(DeviceChangeEvent)
a function that is called whenever a device is added or removed.
a function that is called whenever a device is added or removed .
example
None
use monome::monome;
None
use monome::devicechangeevent;
:register_device_change_callback_with_host("192.168.1.12".parse().unwrap(), |event| {
match event {
DeviceChangeEvent::Added(id) => {
println!("Device {} added", id);
}
DeviceChangeEvent::Removed(id) => {
println!("Device {} removed", id);
}
}
});
```
: register_device_change_callback_with_host ( " 192 . 168 . 1 . 12 " . parse () . unwrap () |event| { match event { DeviceChangeEvent :: Added ( id ) = > { println! ( " Device {} added " id ) ; } DeviceChangeEvent :: Removed ( id ) = > { println! ( " Device {} removed " id ) ; } } } ) ; ` ` `