Jump to content

DelphiUdIT

Members
  • Content Count

    445
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by DelphiUdIT

  1. DelphiUdIT

    TBluetoothLE in Windows 10

    Everything good. Everything works under both Windows and Android (but probably also under MACOS and IOS). The problem I encountered in my last post stemmed from my VERY BAD programming: I assumed that the services were listed in order as the device proposed them (which is true with the original EMB file but not with the changes made). Congratulations @mikerabat, I think EMB will use some of your code in the next versions. Bye
  2. DelphiUdIT

    TBluetoothLE in Windows 10

    I try your last implementation, but with the original Delphi file all is working, while with your solution only one service is found. I'll try to debug whats wrong next week. And, 👍 YES with your solution seems that devices should not be paired anymore. Good work. Bye
  3. DelphiUdIT

    TBluetoothLE in Windows 10

    The WIN32 apis for BlueTooth are system based and are present in: rtl/net/System.Bluetooth rtl/net/System.Bluetooth.Components All systems supported by Delphi have BLE (IOS does not have the classic BlueTooth). I use FMX with BLE because I usually make apps for Android too. Some difference with use of BLE is that with Windows the devices must be paired almost one time to be used with BLE. Bye.
  4. DelphiUdIT

    TBluetoothLE in Windows 10

    I don't know the WinRT API and have never developed a UWP application. I would have created an external timer (a normal TTimer) and called the CancelDiscovery function without "touching" the BLE timer. In normal WIN32 api I do this and I have no problems whatsoever. Bye.
  5. DelphiUdIT

    SysUtils, AnsiString

    For a long time ago (it is not the beginning of a fairy tale ) I have been working with communication systems of various types and when I started to collide with unicode (and the various problems at the time), I started using Indy utilities for data management (even if not necessarily coming from Indy components). In particular, I was more than happy with the utilities and definitions in IdGlobal: TIdBytes, RawToBytes, BytesTo ...... (there is also BytesToString). Until now they have always taken me out of any hindrance in handling byte data. I hope I was helpful. Greetings
  6. DelphiUdIT

    SSL certificate for VCL Application Exe

    To buy and use the device you must have a business in Italy (through the provincial Chamber of Commerce ) or live in Italy. It should be the same for the other Italian providers too, they issue the digital signature on permission of the Italian authority. I don't know if someone in Italy can release a digitally sign to a foreign people. Bye
  7. DelphiUdIT

    SSL certificate for VCL Application Exe

    I live in Italy and I have a digital signature device (USB) that allows me to also sign programs (I use signtool as already indicated in previous posts). The cost is about thirty Euros for the physical USB device (legal duration 6 years) and 20 Euros every 3 years for the renewal of the digital signature. This means an indicative cost of 12 Euros per year. This is not an EV device, so I sign the programs but not the drivers. Precisely for the problem of personal recognition (to be done every 3 years) I have entrusted myself to a government structure spread throughout the territory, so I have no problems with renewals. Those who live in Italy and have a business can easily have this device (among other things it is practically mandatory with us).
  8. DelphiUdIT

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    Since 1996 all the bitmap relevant data is mapped on 4 bytes (included size, width and height). So I think that really in 2007 (release year of the Rad Studio version concerned) it is not likely that there was any bug about it. It is possible that what happens is related to the management of the memory linked to the bitmap (for example umpteenth temporary copies in memory) and above all linked to the use of pfdevice with modern hardware. In fact, currently with the trivial use of a TImage all this works very well. Be carefull that by now, the use of MSPaint or the Rad Studio designer with big picture is not possible, and is related to memory management not to Windows Api or VCL api.
  9. DelphiUdIT

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    I try (before your last post) with an image of 49200 x 6000 pixel 24 bit with stretch and no stretch and no problem arise at runtime. Only in the Rad Studio there are some memory errors cause the 32 bit Rad Studio process. I look at your last answer after lunch. Bye
  10. DelphiUdIT

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    If the api function use the header of a Bitmap, no image more than 4 Gb may be used, because the size of the raw bitmap is mainteined in a 4 byte data, either in 32 bit OS or 64 bit OS: 32768 x 32768 x 24 bit ---> 3 Gb 32768 x 32768 x 32 bit ---> 4 GB Depends wich functions "stretch" setting call (StretcBlt or StretchDIBits) some different things may happens. Also I remember something about api optimized in GDI that sometimes used always the 32 bit rappresentation for bitmap manipulation. This is the original last struct definition for the BITMAPHEADER (should be defined somewhere in the system "pas" files) typedef struct { DWORD bV5Size; LONG bV5Width; LONG bV5Height; WORD bV5Planes; WORD bV5BitCount; DWORD bV5Compression; DWORD bV5SizeImage; LONG bV5XPelsPerMeter; LONG bV5YPelsPerMeter; DWORD bV5ClrUsed; DWORD bV5ClrImportant; DWORD bV5RedMask; DWORD bV5GreenMask; DWORD bV5BlueMask; DWORD bV5AlphaMask; DWORD bV5CSType; CIEXYZTRIPLE bV5Endpoints; DWORD bV5GammaRed; DWORD bV5GammaGreen; DWORD bV5GammaBlue; DWORD bV5Intent; DWORD bV5ProfileData; DWORD bV5ProfileSize; DWORD bV5Reserved; } BITMAPV5HEADER, *PBITMAPV5HEADER;
  11. I have used these functions for years (at least 7) for a remote visualization project in the security field (and not only) and I never had any problems in using them. The pointer of a pointer is simply .... a pointer. There is no need to change the "signature" of the originally imported functions. You may use the pointer argument like in this excerpt of a function (from Robert Jêdrzejczyk's PasLibVlc project): function TPasLibVlcPlayer.GetVideoSampleAspectRatio(var sar_num, sar_den : Longword): Boolean; var md : libvlc_media_t_ptr; tracks_ptr : Pointer; tracks_list : libvlc_media_track_list_t_ptr; tracks_count : Integer; tracks_idx : Integer; track_record : libvlc_media_track_t_ptr; begin Result := FALSE; if (p_mi = NIL) then exit; md := libvlc_media_player_get_media(p_mi); tracks_count := libvlc_media_tracks_get(md, tracks_ptr); if (tracks_count > 0) then begin tracks_list := libvlc_media_track_list_t_ptr(@tracks_ptr); for tracks_idx := 0 to tracks_count-1 do begin track_record := tracks_list^[tracks_idx]; if (track_record^.i_type = libvlc_track_video) then begin sar_num := track_record^.u.video^.i_sar_num; sar_den := track_record^.u.video^.i_sar_den; Result := TRUE; break; end; end; libvlc_media_tracks_release(tracks_ptr, tracks_count); end; end;
  12. DelphiUdIT

    TBluetoothLE in Windows 10

    You must wait near 10.4 seconds (but it's possible that works also in 5 seconds) after the OnEndBluetoothLEScan and after that time you can inquiry the count. This is because Windows fire that event immediatly and doesn't wait any timing. Remember that your devices MUST HAVE BEEN PAIRED at least once with Windows !!! Hope this helps you. Bye
  13. DelphiUdIT

    TBluetoothLE in Windows 10

    The connection parameters are described UUID 00002A04-0000-1000-8000-00805F9B34FB, with 8 bytes data, but this is read only characteristic; you can read the characteristic and see how your BLE device want to be connected. <?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2011 Bluetooth SIG, Inc. All rights reserved. --> <Characteristic xsi:noNamespaceSchemaLocation="http://schemas.bluetooth.org/Documents/characteristic.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Peripheral Preferred Connection Parameters" type="org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters" last-modified="2013-05-29" uuid="2A04"> <InformativeText> <Abstract> <!--The Information included in this page is informative. The normative descriptions are contained in the applicable specification.--> </Abstract> <InformativeDisclaimer /> </InformativeText> <Value> <Field name="Minimum Connection Interval"> <InformativeText>connInterval_min = Minimum Connection Interval * 1.25 ms</InformativeText> <Requirement>Mandatory</Requirement> <Format>uint16</Format> <Minimum>6</Minimum> <Maximum>3200</Maximum> <AdditionalValues> <Enumeration key="65535" value="no specific minimum" /> </AdditionalValues> </Field> <Field name="Maximum Connection Interval"> <InformativeText>connInterval_max = Maximum Connection Interval * 1.25 ms. and is equal or greater than the Minimum Connection Interval</InformativeText> <Requirement>Mandatory</Requirement> <Format>uint16</Format> <Minimum>6</Minimum> <Maximum>3200</Maximum> <AdditionalValues> <Enumeration key="65535" value="no specific maximum" /> </AdditionalValues> </Field> <Field name="Slave Latency"> <Requirement>Mandatory</Requirement> <Format>uint16</Format> <Minimum>0</Minimum> <Maximum>1000</Maximum> </Field> <Field name="Connection Supervision Timeout Multiplier"> <Requirement>Mandatory</Requirement> <Format>uint16</Format> <Minimum>10</Minimum> <Maximum>3200</Maximum> <AdditionalValues> <Enumeration key="65535" value="no specific value requested" /> </AdditionalValues> </Field> </Value>
  14. DelphiUdIT

    TBluetoothLE in Windows 10

    I can make two suggestions: 1) Use Bluetooth LE Lab (https://www.microsoft.com/store/productId/9N6JD37GWZC8) that you find in the Windows store and with that try to write the Gatt characteristic that affect your hardware, so you see the response times with another software; 2) Try to use the BLE connection parameters: these are the settings that an application can try to impose on a BLE device, related to the communication protocol between SERVER GATT and CLIENT GATT (which I never used nor know how to use). The most interesting parameters are the AdvertisingInterval, ConnectionInterval, SlaveLatency, Connection monitoring timeout. But I don't know at this moment how to monitor them or how to set them.
  15. DelphiUdIT

    TBluetoothLE in Windows 10

    I have no news of operating differences on receiving messages in Windows. I tested my application (which I think uses BLE like yours) in MAC, Android and Windows and no change to read and write between the platforms, OnCharacteristicRead should works. Tomorrow I'll tested with BLE device. ……..
  16. DelphiUdIT

    TBluetoothLE in Windows 10

    Yes, stay on BLE specifications the maximum response time should be around 10 seconds. I normaly use about 5 seconds (timer or timeout) (5.2 seconds exactly) and Always all the devices respond. But the logic to "list" the device is different: in Android I use the "end" event, while in Windows I use the "single" discovery event. This should be in that way: if the "end" discovery event works, the "single" discovery event doesn't work and vice versa. I don't know if in the last updates somthing is changed, but surely in that way is working. Bye
  17. DelphiUdIT

    TBluetoothLE in Windows 10

    This is the reference page for Tokyo release: http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Bluetooth.TDiscoverLEDeviceEvent That is the same in the Sydney edition. I don't know if the method is hidden when in use with FMX framework in Tokyo edition. Bye
  18. DelphiUdIT

    TBluetoothLE in Windows 10

    Under Windows you must use "OnDiscoverLEDevice" event. It will be fired for every device discovered. The "OnEndDiscoverDevices" is not fired in Windows, it works on Android Platform. Hope the answer wil be usefull. Bye
  19. DelphiUdIT

    Call stack does not show source unit code

    May be the options "Local symbols" should be flagged and "Symbol reference info" should be set to "Reference Info". "Debug dcu", my experience, is necessary to step in the source system files during debug.
  20. DelphiUdIT

    TBluetoothLE in Windows 10

    Yes, this is true. Windows 10 works only with paired BLE devices. After the first time, means the first time that you paired the devices, Windows 10 do this operation automatically, For some devices the manually paired is not necessary. The devices that i use are without auth protocol and Windows 10 paried them automatically when my app tries to scan and get gatt services.
  21. DelphiUdIT

    TBluetoothLE in Windows 10

    @Rollo62: Thanks for your links. I already use the Nordic microcontrollers, and in particular the BLE devices I was talking about in this post ... they are really them …. Bye
  22. DelphiUdIT

    TBluetoothLE in Windows 10

    @Rollo62: No, both old (Acer I7 Intel) and new PC (Asus I7 Intel) have the integrated Bluetooth. The old one was ( RIP) 3 years old, the new is less then one year old. I think that the malfunction of the old one was about the compatibility with BLE radio spectrum, may be the Bradcomm Bluetooth was not fully certified for BLE. I tried also in the past with old versions of Windows 10 and different Bluetooth constructors with no success. But the failure probably also depends on the implementation of the Windows Bluetooth (stack), which only in Windows 10 and after several releases of the same has been made fully functional. In an old test, while in Windows 10 the BLE devices were not seen, in an Oracle virtual machine with MAC OSX (I don't remember the exact version, I think Sierra) the BLEs were seen .... very curious. Now, in the next weeks (thanks LOCKDOWN ) i restart testing BLE on Windows with various hardware. Bye
  23. DelphiUdIT

    TBluetoothLE in Windows 10

    Now that you have tickled the Bluetooth topic, which I had filed, I tried again with the new PC, which has an Intel Bluetooth compared to the one I tested with which had a BroadComm, and in fact the BLE devices are seen correctly without pair them. To see them I use the TBluetoothLE component and the DiscoverLEDevice event which is called for each BLE device found.
  24. DelphiUdIT

    TBluetoothLE in Windows 10

    From Help: You should "have" the event immedialtly if all is working. I doubt that the BLE is working without any pairing (i cannot try beacuse i don't have any BLE that Windows can see …). If you want to test it after a period, I recommend that you test it after 10.24 seconds. This time comes from a Bluetooth 4.0 specification and is the maximum (worse) response time of a Bluetooth device. I use half of that time (5.2 seconds) and BLE devices always respond ... obviously not tested on Windows platform but on Android. I normally use around seven BLE devices via GATT. There are some answers on Stackoverflow about that (if i remember good). Since I have to work with BLE devices that Windows cannot see, I have given up on developing BLE applications on Windows. Tell us if you will be luckier. Bye
  25. DelphiUdIT

    TBluetoothLE in Windows 10

    This is the explanation why in Windows 10 it is not necessary to "pair" BLE devices. But the devices must be able to pair, which normal BLEs don't.
×