Eliminación del filtro de mensajes
Última modificación:
Esta función elimina uno de los filtros previamente establecidos.
long PassThruStopMsgFilter(unsigned long ChannelID, unsigned long FilterID)
| Código | Descripción | Posibles causas y soluciones |
|---|---|---|
| STATUS_NOERROR | La función se ejecutó correctamente | — |
| ERR_DEVICE_NOT_CONNECTED | No hay conexión con el adaptador |
|
| ERR_INVALID_DEVICE_ID | Identificador de dispositivo no válido |
|
| ERR_INVALID_CHANNEL_ID | Identificador de canal no válido |
|
| ERR_INVALID_FILTER_ID | Identificador de filtro no válido |
|
| ERR_FAILED | Error indeterminado |
|
#include "j2534_lib.hpp"
unsigned long ChannelID; // ID del canal
unsigned long FilterID; // ID del filtro obtenido de PassThruStartMsgFilter
long Ret;
Ret = PassThruStopMsgFilter(ChannelID, FilterID);
if (Ret != STATUS_NOERROR)
{
// Manejo del error
}
// channelID y filterID obtenidos anteriormente
val result = j2534.ptStopMsgFilter(channelID, filterID)
if (result.status == STATUS_NOERROR) {
// Filtro eliminado correctamente
Log.i("J2534", "Filtro $filterID eliminado.")
} else {
// Manejo del error
Log.e("J2534", "Error al eliminar el filtro: ${result.status}")
}
from ctypes import *
# channelID y filterID obtenidos anteriormente
ret = j2534.PassThruStopMsgFilter(channel_id, filter_id)
if ret == 0: # STATUS_NOERROR
print(f"Filtro {filter_id} eliminado")
else:
error = create_string_buffer(256)
j2534.PassThruGetLastError(error)
print(f"Error: {error.value.decode()}")
// channelID y filterID obtenidos anteriormente
int ret = J2534.PassThruStopMsgFilter(channelId, filterId);
if (ret == 0) // STATUS_NOERROR
{
Console.WriteLine($"Filtro {filterId} eliminado");
}
else
{
var error = new StringBuilder(256);
J2534.PassThruGetLastError(error);
Console.WriteLine($"Error: {error}");
}