Hi,
I am working on the port of the nrfutil library of python -> C and I am looking for a support to understand the python code of the nrfutil library please.
Can you help me please.
Best Regards.
Hi,
I am working on the port of the nrfutil library of python -> C and I am looking for a support to understand the python code of the nrfutil library please.
Can you help me please.
Best Regards.
Hi,
Why would you do that, what is the use case? You should be able to use the python version programmatically using the command line interface. I am trying to understand what you need in case there are better options that may save you for a lot of work. What is your end goal, what problem are you trying to solve?
Regards,
Terje
Hi,
Why would you do that, what is the use case? You should be able to use the python version programmatically using the command line interface. I am trying to understand what you need in case there are better options that may save you for a lot of work. What is your end goal, what problem are you trying to solve?
Regards,
Terje
I am working on a communication project ble, is among the objectives of the project is the portage of the function ble in the main.py C is a project a little critical that requires less space of the memory c is why I am carrying a C or assembler
that's the function I need
github.com/.../dfu_transport_ble.py
def send_init_packet(self, init_packet):
def try_to_recover():
if response['offset'] == 0 or response['offset'] > len(init_packet):
# There is no init packet or present init packet is too long.
return False
expected_crc = (binascii.crc32(init_packet[:response['offset']]) & 0xFFFFFFFF)
if expected_crc != response['crc']:
# Present init packet is invalid.
return False
if len(init_packet) > response['offset']:
# Send missing part.
try:
self.__stream_data(data = init_packet[response['offset']:],
crc = expected_crc,
offset = response['offset'])
except ValidationException:
return False
self.__execute()
return True
response = self.__select_command()
assert len(init_packet) <= response['max_size'], 'Init command is too long'
if try_to_recover():
return
for r in range(DfuTransportBle.RETRIES_NUMBER):
try:
self.__create_command(len(init_packet))
self.__stream_data(data=init_packet)
self.__execute()
except ValidationException:
pass
break
else:
raise NordicSemiException("Failed to send init packet")