MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / get_device_name

Method get_device_name

python_package/brainflow/board_shim.py:875–893  ·  view source on GitHub ↗

get device name :param board_id: Board Id :type board_id: int :param preset: preset :type preset: int :return: Device Name :rtype: str :raises BrainFlowError: If this board has no such data exit code is UNSUPPORTED_BOARD_ERROR

(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET)

Source from the content-addressed store, hash-verified

873
874 @classmethod
875 def get_device_name(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> str:
876 """get device name
877
878 :param board_id: Board Id
879 :type board_id: int
880 :param preset: preset
881 :type preset: int
882 :return: Device Name
883 :rtype: str
884 :raises BrainFlowError: If this board has no such data exit code is UNSUPPORTED_BOARD_ERROR
885 """
886
887 string = numpy.zeros(4096).astype(numpy.ubyte)
888 string_len = numpy.zeros(1).astype(numpy.int32)
889 res = BoardControllerDLL.get_instance().get_device_name(
890 board_id, preset, string, string_len, string.size)
891 if res != BrainFlowExitCodes.STATUS_OK.value:
892 raise BrainFlowError('unable to request info about this board', res)
893 return string.tobytes().decode('utf-8')[0:string_len[0]]
894
895 @classmethod
896 def get_eeg_channels(cls, board_id: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> List[int]:

Callers

nothing calls this directly

Calls 3

BrainFlowErrorClass · 0.90
get_device_nameMethod · 0.65
get_instanceMethod · 0.45

Tested by

no test coverage detected