NMDeviceWifiP2P: libnm Reference Manual

## NMDeviceWifiP2P NMDeviceWifiP2P |

## Functions

const char * | nm_device_wifi_p2p_get_hw_address ()
NMWifiP2PPeer * | nm_device_wifi_p2p_get_peer_by_path ()
const GPtrArray * | nm_device_wifi_p2p_get_peers ()
void | nm_device_wifi_p2p_start_find ()
gboolean | nm_device_wifi_p2p_start_find_finish ()
void | nm_device_wifi_p2p_stop_find ()
gboolean | nm_device_wifi_p2p_stop_find_finish ()

## Types and Values

#define | NM_DEVICE_WIFI_P2P_HW_ADDRESS
#define | NM_DEVICE_WIFI_P2P_PEERS
#define | NM_DEVICE_WIFI_P2P_WFDIES

## Description

## Functions

### nm_device_wifi_p2p_get_hw_address ()

    const char *
    nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device);

Gets the actual hardware (MAC) address of the NMDeviceWifiP2P

#### Parameters

device | a NMDeviceWifiP2P |

#### Returns

the actual hardware address. This is the internal string used by the device, and must not be modified.

Since: 1.16

### nm_device_wifi_p2p_get_peer_by_path ()

    NMWifiP2PPeer *
    nm_device_wifi_p2p_get_peer_by_path (NMDeviceWifiP2P *device,
                                         const char *path);

Gets a NMWifiP2PPeer by path.

#### Parameters

device | a NMDeviceWifiP2P |
path | the object path of the peer |

#### Returns

the peer or `NULL` if none is found.

[transfer none]

Since: 1.16

### nm_device_wifi_p2p_get_peers ()

    const GPtrArray *
    nm_device_wifi_p2p_get_peers (NMDeviceWifiP2P *device);

Gets all the found peers of the NMDeviceWifiP2P.

#### Parameters

device | a NMDeviceWifiP2P |

#### Returns

a GPtrArray containing all the found NMWifiP2PPeers. The returned array is owned by the client and should not be modified.

[element-type NMWifiP2PPeer]

Since: 1.16

### nm_device_wifi_p2p_start_find ()

    void
    nm_device_wifi_p2p_start_find (NMDeviceWifiP2P *device,
                                   GVariant *options,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Request NM to search for Wi-Fi P2P peers on `device` . Note that the call returns immediately after requesting the find, and it may take some time after that for peers to be found.

The find operation will run for 30s by default. You can stop it earlier using `nm_device_p2p_wifi_stop_find()`.

#### Parameters

device | a NMDeviceWifiP2P |
options | optional options passed to StartFind. | [allow-none]
cancellable | a GCancellable, or `NULL` |
callback | a GAsyncReadyCallback, or `NULL` |
user_data | user_data for `callback` |

Since: 1.16

### nm_device_wifi_p2p_start_find_finish ()

    gboolean
    nm_device_wifi_p2p_start_find_finish (NMDeviceWifiP2P *device,
                                          GAsyncResult *result,
                                          GError **error);

Finish an operation started by `nm_device_wifi_p2p_start_find()`.

#### Parameters

device | a NMDeviceWifiP2P |
result | the GAsyncResult |
error | GError return address |

#### Returns

`TRUE` if the call was successful

Since: 1.16

### nm_device_wifi_p2p_stop_find ()

    void
    nm_device_wifi_p2p_stop_find (NMDeviceWifiP2P *device,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Request NM to stop any ongoing find operation for Wi-Fi P2P peers on `device` .

#### Parameters

device | a NMDeviceWifiP2P |
cancellable | a GCancellable, or `NULL` |
callback | a GAsyncReadyCallback, or `NULL` |
user_data | user_data for `callback` |

Since: 1.16

### nm_device_wifi_p2p_stop_find_finish ()

    gboolean
    nm_device_wifi_p2p_stop_find_finish (NMDeviceWifiP2P *device,
                                         GAsyncResult *result,
                                         GError **error);

Finish an operation started by `nm_device_wifi_p2p_stop_find()`.

#### Parameters

device | a NMDeviceWifiP2P |
result | the GAsyncResult |
error | GError return address |

#### Returns

`TRUE` if the call was successful

Since: 1.16

## Types and Values

### NM_DEVICE_WIFI_P2P_HW_ADDRESS

    #define NM_DEVICE_WIFI_P2P_HW_ADDRESS          "hw-address"

### NM_DEVICE_WIFI_P2P_PEERS

    #define NM_DEVICE_WIFI_P2P_PEERS               "peers"

### NM_DEVICE_WIFI_P2P_WFDIES

    #define NM_DEVICE_WIFI_P2P_WFDIES              "wfdies"