ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / OBEX functions
  • Location of the copied file
  • Transferring files by infrared
  • Limitation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
OBEXSendFile (Function)
In french: OBEXEnvoieFichier
Sends a file to a device that supports the OBEX protocol.
Example
// Connexion Bluetooth
IF BTConnectDevice(COL_ID, "123") = True THEN
// Connexion OBEX
nIDCnxOBEX = OBEXConnect(obexBluetooth, COL_MAC)
// Transfert du fichier
TABLE_PERIPHERIQUES[TABLE_PERIPHERIQUES].CouleurFond = ...
  SWITCH (OBEXSendFile(nIDCnxOBEX, sFichier), ...
White, PastelRed)
// Fin du transfert
OBEXDisconnect(nIDCnxOBEX)
ELSE
 Error("Impossible de se connecter à " + COL_PERIPHERIQUE, ErrorInfo())
END
Syntax
<Result> = OBEXSendFile(<Identifier of OBEX connection> , <Local file path> [, <Remote file path>])
<Result>: Boolean
  • True if the transfer was successful,
  • False otherwise. ErrorInfo returns more information on the error.
Caution: The sender is not notified if the file is refused by the remote computer: ErrorInfo contains no specific error code. The ErrorInfo function contains only error messages concerning the transmission.
<Identifier of OBEX connection>: Integer
Identifier of OBEX connection to use. This identifier is returned by OBEXConnect.
<Local file path>: Character string
Name and full path of the file to send.
<Remote file path>: Optional character string
Name and path of the file on the remote device. If this parameter is not specified, the file keeps the same name and it is copied into the transfer directory configured on the OBEX device.
Remarks

Location of the copied file

The file is copied into the transfer directory configured on the OBEX device used. If <Remote File Path> is specified, the specified path will be relative to the transfer directory.

Transferring files by infrared

When transferring files via infrared, the transfer is completed after OBEXSendFile. However, Windows keep the transfer window opened (to manage a possible new file transfer). This window is only closed when disconnecting (OBEXDisconnect).

Limitation

Only the Microsoft bluetooth stacks are supported by this function. To find out which battery is in use, use the BTStack function.
For more details, see Which stacks to use?
Component: wd270com.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help