Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I tried the server in example folder, but I cannot find the ble server on my iphone #138

Closed
unicorn200066 opened this issue Sep 27, 2024 · 1 comment

Comments

@unicorn200066
Copy link

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
If applicable, provide a clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@unicorn200066
Copy link
Author

`import asyncio
import logging
import uuid
from time import sleep
from typing import Optional

from bless import *

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(name=name)

async def test_ble_server(loop):
trigger = asyncio.Event()
trigger.clear()
server : BlessServer = BlessServer("MyBleServer", loop=loop)

service_uuid : str = str(uuid.uuid4())
await server.add_new_service(service_uuid)


char_uuid : str = str(uuid.uuid4())
char_flags: GATTCharacteristicProperties = (
        GATTCharacteristicProperties.read |
        GATTCharacteristicProperties.write |
        GATTCharacteristicProperties.notify
)
value: Optional[bytearray] = None
permissions: GATTAttributePermissions = (
        GATTAttributePermissions.readable |
        GATTAttributePermissions.writeable
)
await server.add_new_characteristic(service_uuid, char_uuid, char_flags, value, permissions)

await server.start()
logger.info(f"server name is {server.name}")
is_advertising = await server.is_advertising()
logger.info(f"server is advertising: {is_advertising}")

await trigger.wait()

if name == "main":
loop = asyncio.get_event_loop()
loop.run_until_complete(test_ble_server(loop))

`

I ran the code above, however while the server is running, I could not find "MyBleServer" device on my iphone

Repository owner locked and limited conversation to collaborators Sep 27, 2024
@kevincar kevincar converted this issue into discussion #139 Sep 27, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant