本文整理汇总了C++中BluetoothOppManager::SendFile方法的典型用法代码示例。如果您正苦于以下问题:C++ BluetoothOppManager::SendFile方法的具体用法?C++ BluetoothOppManager::SendFile怎么用?C++ BluetoothOppManager::SendFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BluetoothOppManager
的用法示例。
在下文中一共展示了BluetoothOppManager::SendFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DispatchBluetoothReply
void
BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
BlobParent* aBlobParent,
BlobChild* aBlobChild,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
// Force to stop discovery, otherwise socket connecting would fail
if (!IsReady() || BT_STATUS_SUCCESS != sBtInterface->cancel_discovery()) {
NS_NAMED_LITERAL_STRING(errorStr, "Calling cancel_discovery() failed");
DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
return;
}
// Currently we only support one device sending one file at a time,
// so we don't need aDeviceAddress here because the target device
// has been determined when calling 'Connect()'. Nevertheless, keep
// it for future use.
BluetoothOppManager* opp = BluetoothOppManager::Get();
nsAutoString errorStr;
if (!opp || !opp->SendFile(aDeviceAddress, aBlobParent)) {
errorStr.AssignLiteral("Calling SendFile() failed");
}
DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
}
示例2: SendFile
void
BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
nsIDOMBlob* aBlob,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
// Currently we only support one device sending one file at a time,
// so we don't need aDeviceAddress here because the target device
// has been determined when calling 'Connect()'. Nevertheless, keep
// it for future use.
BluetoothOppManager* opp = BluetoothOppManager::Get();
nsAutoString errorStr;
if (!opp || !opp->SendFile(aDeviceAddress, aBlob)) {
errorStr.AssignLiteral("Calling SendFile() failed");
}
DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
}
示例3: DispatchReplyError
void
BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
nsIDOMBlob* aBlob,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
// Currently we only support one device sending one file at a time,
// so we don't need aDeviceAddress here because the target device
// has been determined when calling 'Connect()'. Nevertheless, keep
// it for future use.
BluetoothOppManager* opp = BluetoothOppManager::Get();
if (!opp || !opp->SendFile(aDeviceAddress, aBlob)) {
DispatchReplyError(aRunnable, NS_LITERAL_STRING("SendFile failed"));
return;
}
DispatchReplySuccess(aRunnable);
}